mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 04:23:01 +00:00
Merge pull request #2881 from minrk/auth-state-earlier
trigger auth_state_hook prior to options form, add auth_state to template namespace
This commit is contained in:
@@ -530,12 +530,17 @@ class User:
|
||||
# trigger pre-spawn hook on authenticator
|
||||
authenticator = self.authenticator
|
||||
try:
|
||||
spawner._start_pending = True
|
||||
|
||||
if authenticator:
|
||||
# pre_spawn_start can thow errors that can lead to a redirect loop
|
||||
# if left uncaught (see https://github.com/jupyterhub/jupyterhub/issues/2683)
|
||||
await maybe_future(authenticator.pre_spawn_start(self, spawner))
|
||||
|
||||
spawner._start_pending = True
|
||||
# trigger auth_state hook
|
||||
auth_state = await self.get_auth_state()
|
||||
await spawner.run_auth_state_hook(auth_state)
|
||||
|
||||
# update spawner start time, and activity for both spawner and user
|
||||
self.last_activity = (
|
||||
spawner.orm_spawner.started
|
||||
|
Reference in New Issue
Block a user