jupyterhub / tmpauthenticator

JupyterHub authenticator that hands out temporary accounts for everyone. For use in tmpnb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should TmpAuthenticator replace traitlets with booleans, or provide a new default value?

consideRatio opened this issue · comments

If we have it like this, I think it makes it impossible for the user to change auto_login if they would like to. Is it a better practice to provide a new default value for the super class' existing auto_login traitlet?

I'm thining for example like:

from traitlets import default

class TmpAuthenticator(Authenticator):
    @default("auto_login")
    def _auto_login_default(self):
        return True

Related

From jupyterhub's auth.py.

    auto_login = Bool(
        False,
        config=True,
        help="""Automatically begin the login process

        rather than starting with a "Login with..." link at `/hub/login`

        To work, `.login_url()` must give a URL other than the default `/hub/login`,
        such as an oauth handler or another automatic login handler,
        registered with `.get_handlers()`.

        .. versionadded:: 0.8
        """,
    )

Might be useful to try it out, would allow us to have an actual home page with a 'login' button. This wasn't required for tmpnb so we didn't support it. We could support it now.

@consideRatio turns out this is simpler than I thought :) Here's a (mostly docs) PR #41