mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 15:03:02 +00:00
Don't overwrite class name when patching-in hub auth
This commit is contained in:
@@ -79,9 +79,12 @@ class JupyterHubLoginHandler(LoginHandler):
|
||||
def get_user(handler):
|
||||
"""alternative get_current_user to query the Hub"""
|
||||
# patch in HubAuthenticated class for querying the Hub for cookie authentication
|
||||
name = 'NowHubAuthenticated'
|
||||
if handler.__class__.__name__ != name:
|
||||
handler.__class__ = type(name, (HubAuthenticatedHandler, handler.__class__), {})
|
||||
if HubAuthenticatedHandler not in handler.__class__.__bases__:
|
||||
handler.__class__ = type(
|
||||
handler.__class__.__name__,
|
||||
(HubAuthenticatedHandler, handler.__class__),
|
||||
{},
|
||||
)
|
||||
return handler.get_current_user()
|
||||
|
||||
@classmethod
|
||||
|
Reference in New Issue
Block a user