mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 06:52:59 +00:00
UserTokenListAPIHandler should support Authenticator.authenticate returning a dict
This commit is contained in:
@@ -243,6 +243,9 @@ class UserTokenListAPIHandler(APIHandler):
|
||||
# can be username+password or an upstream auth token
|
||||
try:
|
||||
name = await self.authenticator.authenticate(self, body.get('auth'))
|
||||
if isinstance(name, dict):
|
||||
# not a simple string so it has to be a dict
|
||||
name = name.get('name')
|
||||
except web.HTTPError as e:
|
||||
# turn any authentication error into 403
|
||||
raise web.HTTPError(403)
|
||||
|
Reference in New Issue
Block a user