mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 07:53: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
|
||||
@@ -156,4 +159,4 @@ class PAMAuthenticator(LocalAuthenticator):
|
||||
bpassword = data['password'].encode(self.encoding)
|
||||
if simplepam.authenticate(busername, bpassword, service=self.service):
|
||||
return username
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user