mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 16:03:00 +00:00
DEV: Make login a base-class default on Authenticator.get_handlers.
Rather than a module-level default. Makes it easier for custom Authenticators to unmount /login.
This commit is contained in:
@@ -12,6 +12,7 @@ import simplepam
|
||||
from IPython.config import LoggingConfigurable
|
||||
from IPython.utils.traitlets import Bool, Set, Unicode
|
||||
|
||||
from .handlers.login import LoginHandler
|
||||
from .utils import url_path_join
|
||||
|
||||
class Authenticator(LoggingConfigurable):
|
||||
@@ -70,7 +71,9 @@ class Authenticator(LoggingConfigurable):
|
||||
|
||||
(e.g. for OAuth)
|
||||
"""
|
||||
return []
|
||||
return [
|
||||
('/login', LoginHandler),
|
||||
]
|
||||
|
||||
class LocalAuthenticator(Authenticator):
|
||||
"""Base class for Authenticators that work with local *ix users
|
||||
|
@@ -69,7 +69,8 @@ class LoginHandler(BaseHandler):
|
||||
)
|
||||
self.finish(html)
|
||||
|
||||
|
||||
# Only logout is a default handler.
|
||||
default_handlers = [
|
||||
(r"/login", LoginHandler),
|
||||
(r"/logout", LogoutHandler),
|
||||
]
|
||||
|
Reference in New Issue
Block a user