From f84a88da21e6e30558045785f4a6892d7cfefe83 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 14 Sep 2017 16:06:36 +0200 Subject: [PATCH] fix oauth state redirect check for HubOAuth, not HubOAuthenticated --- jupyterhub/services/auth.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/jupyterhub/services/auth.py b/jupyterhub/services/auth.py index 8e5fbf7e..b1f8e6cf 100644 --- a/jupyterhub/services/auth.py +++ b/jupyterhub/services/auth.py @@ -657,13 +657,12 @@ class HubAuthenticated(object): def get_login_url(self): """Return the Hub's login URL""" login_url = self.hub_auth.login_url - app_log.debug("Redirecting to login url: %s", login_url) - if isinstance(self.hub_auth, HubOAuthenticated): + if isinstance(self.hub_auth, HubOAuth): # add state argument to OAuth url state = self.hub_auth.set_state_cookie(self, next_url=self.request.uri) - return url_concat(login_url, {'state': state}) - else: - return login_url + login_url = url_concat(login_url, {'state': state}) + app_log.debug("Redirecting to login url: %s", login_url) + return login_url def check_hub_user(self, model): """Check whether Hub-authenticated user or service should be allowed.