Commit dbb75437 authored by echel0n's avatar echel0n
Browse files

Fixed issue with custom webroot and too many redirects

parent a7d02096
# Changelog
- * ff41597 - 2018-09-17: Pre-Release v9.3.79.dev10
- * d6ddfdb - 2018-09-18: Fixed issue with custom webroot and too many redirects
- * a7d0209 - 2018-09-17: Pre-Release v9.3.79.dev10
- * 09b1857 - 2018-09-17: Pre-Release v9.3.79.dev9
- * 3419702 - 2018-09-16: Pre-Release v9.3.79.dev8
- * a4a4814 - 2018-09-16: Pre-Release v9.3.79.dev7
......
......@@ -300,10 +300,11 @@ class LoginHandler(BaseHandler):
except Exception as e:
return self.redirect('/logout')
redirect_page = self.get_argument('next', "/{}/".format(sickrage.app.config.default_page))
return self.redirect("{}".format(redirect_page))
redirect_uri = self.get_argument('next', "/{}/".format(sickrage.app.config.default_page))
return self.redirect("{}".format(redirect_uri))
else:
self.redirect(sickrage.app.oidc_client.authorization_url(redirect_uri=redirect_uri))
authorization_url = sickrage.app.oidc_client.authorization_url(redirect_uri=redirect_uri)
return super(BaseHandler, self).redirect(authorization_url)
class LogoutHandler(BaseHandler):
......@@ -311,11 +312,15 @@ class LogoutHandler(BaseHandler):
super(LogoutHandler, self).__init__(*args, **kwargs)
def prepare(self, *args, **kwargs):
logout_uri = sickrage.app.oidc_client.get_url('end_session_endpoint')
redirect_uri = "{}://{}{}/login".format(self.request.protocol, self.request.host, sickrage.app.config.web_root)
if self.get_secure_cookie('sr_refresh_token'):
sickrage.app.oidc_client.logout(self.get_secure_cookie('sr_refresh_token'))
self.clear_all_cookies()
return self.redirect('/login/')
return super(BaseHandler, self).redirect('{}?redirect_uri={}'.format(logout_uri, redirect_uri))
class CalendarHandler(BaseHandler):
......
Supports Markdown
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