From c833fae9011bb88f16cf0aff5737c58149a9beb5 Mon Sep 17 00:00:00 2001 From: Daisuke Taniwaki Date: Wed, 23 Dec 2020 13:39:59 +0900 Subject: [PATCH] Allow to use base URL in custom HTML --- jupyterhub/auth.py | 3 +++ jupyterhub/handlers/login.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/jupyterhub/auth.py b/jupyterhub/auth.py index 33a00bef..98308610 100644 --- a/jupyterhub/auth.py +++ b/jupyterhub/auth.py @@ -1101,6 +1101,9 @@ class PAMAuthenticator(LocalAuthenticator): else: return super().normalize_username(username) + def get_custom_html(self, base_url): + return self.custom_html + for _old_name, _new_name, _version in [ ("check_group_whitelist", "check_group_allowed", "1.2"), diff --git a/jupyterhub/handlers/login.py b/jupyterhub/handlers/login.py index 16f26f1a..599c8540 100644 --- a/jupyterhub/handlers/login.py +++ b/jupyterhub/handlers/login.py @@ -101,7 +101,7 @@ class LoginHandler(BaseHandler): {'next': self.get_argument('next', '')}, ), } - custom_html = Template(self.authenticator.custom_html).render(**context) + custom_html = Template(self.authenticator.get_custom_html(self.hub.base_url)).render(**context) return self.render_template( 'login.html', **context,