mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33: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):
|
def get_user(handler):
|
||||||
"""alternative get_current_user to query the Hub"""
|
"""alternative get_current_user to query the Hub"""
|
||||||
# patch in HubAuthenticated class for querying the Hub for cookie authentication
|
# patch in HubAuthenticated class for querying the Hub for cookie authentication
|
||||||
name = 'NowHubAuthenticated'
|
if HubAuthenticatedHandler not in handler.__class__.__bases__:
|
||||||
if handler.__class__.__name__ != name:
|
handler.__class__ = type(
|
||||||
handler.__class__ = type(name, (HubAuthenticatedHandler, handler.__class__), {})
|
handler.__class__.__name__,
|
||||||
|
(HubAuthenticatedHandler, handler.__class__),
|
||||||
|
{},
|
||||||
|
)
|
||||||
return handler.get_current_user()
|
return handler.get_current_user()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Reference in New Issue
Block a user