Fix login in to new instance

This commit is contained in:
localhost_frssoft 2023-06-14 15:27:15 +03:00
parent 9ec77975e5
commit dc40e5331c
2 changed files with 7 additions and 6 deletions

View file

@ -39,14 +39,14 @@ class current_instance:
def select_instance(new_instance=None):
current_instance.instance = new_instance
with open(auth_file, 'rt') as f:
auth = json.loads(f.read())
auth = json.load(f)
new_token = auth.get(current_instance.instance)
current_instance.s.headers.update({"Authorization": None})
current_instance.token = new_token
current_instance.listen_token = None
if new_token:
s.get(f'https://{current_instance.instance}')
s.headers.update({"Authorization": "Bearer " + new_token})
current_instance.s.get(f'https://{current_instance.instance}')
current_instance.s.headers.update({"Authorization": "Bearer " + new_token})
if current_instance.token: