Commit ae5c4788 authored by echel0n's avatar echel0n

Fixed auth issue causing redirect to home page every 5 minutes.

parent aaec0286
# Changelog
- * 359f452 - 2019-01-20: Release v9.4.56
- * 276ee99 - 2019-01-21: Fixed auth issue causing redirect to home page every 5 minutes.
- * b2b9f0d - 2019-01-20: Release v9.4.56
- * a2596ce - 2019-01-20: Fixed typo in show schedule page, double web roots.
- * 468c19e - 2019-01-19: Decreased sleep timer from 5s to 2s for RARBG. Updated keycloak client requirement version.
- * 25bcd7f - 2019-01-12: Pre-Release v9.4.56.dev5
......
......@@ -32,6 +32,7 @@ import dateutil.tz
import markdown2
import tornado.gen
import tornado.locale
from keycloak.exceptions import KeycloakClientError
from mako.exceptions import RichTraceback
from mako.lookup import TemplateLookup
from requests import HTTPError
......@@ -144,12 +145,12 @@ class BaseHandler(RequestHandler):
try:
try:
return sickrage.app.oidc_client.userinfo(self.get_secure_cookie('sr_access_token'))
except HTTPError:
except (KeycloakClientError, HTTPError):
token = sickrage.app.oidc_client.refresh_token(self.get_secure_cookie('sr_refresh_token'))
self.set_secure_cookie('sr_access_token', token['access_token'])
self.set_secure_cookie('sr_refresh_token', token['refresh_token'])
return sickrage.app.oidc_client.userinfo(token['access_token'])
except Exception:
except Exception as e:
pass
def render_string(self, template_name, **kwargs):
......
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