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:
Scott Sanderson
2015-01-14 17:40:57 -05:00
parent 63a06c6ae0
commit 4c5de826c4
2 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -69,7 +69,8 @@ class LoginHandler(BaseHandler):
)
self.finish(html)
# Only logout is a default handler.
default_handlers = [
(r"/login", LoginHandler),
(r"/logout", LogoutHandler),
]