UserTokenListAPIHandler should support Authenticator.authenticate returning a dict

This commit is contained in:
Gerhard Weis
2018-11-22 13:25:57 +10:00
parent c9c0d3723b
commit 9ac6ed344c
2 changed files with 30 additions and 0 deletions

View File

@@ -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)