diff --git a/jupyterhub/services/auth.py b/jupyterhub/services/auth.py index 32e999ae..a754e706 100644 --- a/jupyterhub/services/auth.py +++ b/jupyterhub/services/auth.py @@ -731,6 +731,11 @@ class HubAuthenticated(object): except Exception: self._hub_auth_user_cache = None raise + token = self.get_argument('token', '') + if user_model and token and getattr(self, '_token_authenticated', False): + # authenticated via `?token=` + # set a cookie for future requests + self.hub_auth.set_cookie(self, token) return self._hub_auth_user_cache