diff --git a/extra-assets/css/login.css b/extra-assets/css/login.css deleted file mode 100644 index fb33bf6..0000000 --- a/extra-assets/css/login.css +++ /dev/null @@ -1,81 +0,0 @@ -#home { - margin-top: 32px -} - -.login-container { - margin-top: 32px; -} - -#login-button { - margin-top: 32px; -} -#operated-by { - margin-top: 8px; - color: darkgrey; -} - -#operated-by a { - color:grey; - font-weight: bold; -} - -.details { - margin-top: 32px; -} - -.details-welcome { - color: black; -} - -.details-logos img { - margin: 12px; - text-align: right; -} - -.details p { - color: grey; -} - -.announcements { - margin-top: 8px; -} - -.announcements > div { - margin-top: 16px; - padding-top: 4px; - padding-bottom: 5px; - border: 2px dotted orange; -} - -.announcements-text { - padding-left: 10px; -} - -.questions { - margin-top: 12px; -} - -.questions > div { - margin-top: 32px; - padding-bottom: 32px; - border-bottom: 2px lightgrey dotted; -} - -.footer { - padding-top: 64px; - text-align: center; - color: darkgrey; -} - -.footer a { - color: darkgrey; - text-decoration: underline; -} - -p.hub-login-text { - font-size: 1.5em; -} - -div.login-header img.hub-logo { - width: 40%; -} diff --git a/extra-assets/images/home-hero.png b/extra-assets/images/home-hero.png deleted file mode 100644 index aa1206f..0000000 Binary files a/extra-assets/images/home-hero.png and /dev/null differ diff --git a/extra-assets/images/jupyter-logo.svg b/extra-assets/images/jupyter-logo.svg deleted file mode 100644 index fb2921a..0000000 --- a/extra-assets/images/jupyter-logo.svg +++ /dev/null @@ -1,88 +0,0 @@ - diff --git a/extra-assets/images/rstudio-logo.svg b/extra-assets/images/rstudio-logo.svg deleted file mode 100644 index b0401ca..0000000 --- a/extra-assets/images/rstudio-logo.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - diff --git a/extra-assets/js/login.js b/extra-assets/js/login.js index 96290f7..b4552ed 100644 --- a/extra-assets/js/login.js +++ b/extra-assets/js/login.js @@ -1,32 +1,20 @@ -function redirectIfNeeded() { - // Only redirect utoronto.2i2c.cloud, lets us keep staging at staging.utoronto.2i2c.cloud - if (window.location.hostname === 'utoronto.2i2c.cloud') { - // Let's give users an indication that something is happening - document.write("Redirecting you to jupyter.utoronto.ca"); - window.location.hostname = 'jupyter.utoronto.ca'; - } +// This code must be run *as early as possible*, as we care about redirecting the user +// *somewhere* immediately. So this isn't wrapped in a window.onload or similar, but bare. +// This code is also loaded directly in
, so it will block page load. +const curUrl = new URL(document.location); +// if next query param is presentm just do nothing +const nextUrl = curUrl.searchParams.get('next'); +// /hub/ being next should be treated same as no next present +if (!nextUrl || nextUrl === "/hub/") { + // The 'unified' home page for all the hubs is at https://datatools.utoronto.ca, + // so anyone landing on the home page should just be redirected. + window.location.replace("https://datatools.utoronto.ca"); +} else { + // The user has landed on this page, which means they are not actually logged in, + // and need to login to continue to wherever they are going. So let's construct the + // appropriate oauth_login URL for them to go to. + let oauthLoginUrl = new URL(document.location); + // Pass along all url parameters we got, just change from /login to /oauth_login + oauthLoginUrl.pathname = "/oauth_login"; + window.location.replace(oauthLoginUrl); } -function setInterface(interfaceUrl) { - let loginUrl = new URL($('#home').data('authenticator-login-url'), document.location.origin); - loginUrl.searchParams.set('next', '/hub/user-redirect/' + interfaceUrl) - $('#login-button').attr( - 'href', - loginUrl.toString() - ); -} -$(function() { - redirectIfNeeded(); - // if next query param is presentm just do nothing - const nextPresent = new URL(document.location).searchParams.get('next'); - // /hub/ being next should be treated same as no next present - if (!nextPresent || nextPresent === "/hub/") { - setInterface($("input[name='interface']:checked").val()); - - $("input[name='interface']").change(function() { - if (this.checked) { - setInterface(this.value) - } - }); - } - -}) \ No newline at end of file diff --git a/templates/error.html b/templates/error.html index 4c04c19..e5b2c69 100644 --- a/templates/error.html +++ b/templates/error.html @@ -1,7 +1,7 @@ {% extends "templates/error.html" %} {% block error_detail %} -{% if status_code == 403 %} +{% if status_code == 500 %}The 2i2c JupyterHub for {{ custom.org.name }}