Commit 8ae0f5d6 authored by echel0n's avatar echel0n

Added debug logging for login issues.

Cookie decoded to string from byte-string, resolves issues with json decoding and login issues.
parent 8d7cc284
......@@ -106,14 +106,15 @@ class BaseHandler(RequestHandler, ABC):
return
try:
token = json.loads(cookie)
token = json.loads(cookie.decode("utf-8"))
try:
return sickrage.app.oidc_client.userinfo(token['access_token'])
except KeycloakClientError as e:
except KeycloakClientError:
token = sickrage.app.oidc_client.refresh_token(token['refresh_token'])
self.set_secure_cookie('_sr', json.dumps(token))
return sickrage.app.oidc_client.userinfo(token['access_token'])
except Exception:
except Exception as e:
sickrage.app.log.debug('{!r}'.format(e))
pass
def render_string(self, template_name, **kwargs):
......
......@@ -60,6 +60,7 @@ class LoginHandler(BaseHandler, ABC):
API().logout()
API().token = token
except Exception as e:
sickrage.app.log.debug('{!r}'.format(e))
return self.redirect('/logout')
if not sickrage.app.config.app_id:
......
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