Commit a73aa968 authored by echel0n's avatar echel0n

Fixed issue with unlinking accounts and destroying token

parent d04f0f53
......@@ -55,8 +55,12 @@ class API(object):
@token.setter
def token(self, value):
token = value.decode() if isinstance(value, bytes) else value
if not isinstance(token, dict):
token = {}
if token.get('expires_in'):
token['expires_at'] = int(time.time() + token['expires_in'])
with open(self.token_file, 'w') as fd:
json.dump(token, fd)
......
......@@ -239,7 +239,8 @@ class UnlinkHandler(BaseHandler, ABC):
sickrage.app.config.sub_id = ""
sickrage.app.config.save()
API().token = sickrage.app.oidc_client.logout(API().token['refresh_token'])
sickrage.app.oidc_client.logout(API().token['refresh_token'])
API().token = {}
return self.redirect('/logout/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment