mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 22:43:00 +00:00
move add_user call for new users to login_user
previous location was in a non-awaitable call
This commit is contained in:
@@ -410,7 +410,10 @@ class BaseHandler(RequestHandler):
|
|||||||
username = authenticated['name']
|
username = authenticated['name']
|
||||||
auth_state = authenticated.get('auth_state')
|
auth_state = authenticated.get('auth_state')
|
||||||
admin = authenticated.get('admin')
|
admin = authenticated.get('admin')
|
||||||
|
new_user = username not in self.users
|
||||||
user = self.user_from_username(username)
|
user = self.user_from_username(username)
|
||||||
|
if new_user:
|
||||||
|
yield gen.maybe_future(self.authenticator.add_user(user))
|
||||||
# Only set `admin` if the authenticator returned an explicit value.
|
# Only set `admin` if the authenticator returned an explicit value.
|
||||||
if admin is not None and admin != user.admin:
|
if admin is not None and admin != user.admin:
|
||||||
user.admin = admin
|
user.admin = admin
|
||||||
|
Reference in New Issue
Block a user