Commit 355e96e6 authored by echel0n's avatar echel0n

Fixed issues with login cookies not storing in chrome or safari browsers...

Fixed issues with login cookies not storing in chrome or safari browsers causing failed login attempts.
parent 3823a177
......@@ -111,7 +111,7 @@ class BaseHandler(RequestHandler, ABC):
return sickrage.app.oidc_client.userinfo(token['access_token'])
except KeycloakClientError:
token = sickrage.app.oidc_client.refresh_token(token['refresh_token'])
self.set_secure_cookie('_sr', json.dumps(token))
self.set_secure_cookie('_sr', json.dumps({'access_token': token['access_token'], 'refresh_token': token['refresh_token']}))
return sickrage.app.oidc_client.userinfo(token['access_token'])
except Exception as e:
sickrage.app.log.debug('{!r}'.format(e))
......
......@@ -38,7 +38,7 @@ class LoginHandler(BaseHandler, ABC):
token = sickrage.app.oidc_client.authorization_code(code, redirect_uri)
userinfo = sickrage.app.oidc_client.userinfo(token['access_token'])
self.set_secure_cookie('_sr', json.dumps(token))
self.set_secure_cookie('_sr', json.dumps({'access_token': token['access_token'], 'refresh_token': token['refresh_token']}))
if not userinfo.get('sub'):
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