mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-13 04:53:01 +00:00
Show insecure login warning when not in a secure context
Secure contexts are a more robust way of checking that a browsing context is authenticated and confidential. Compared to comparing the scheme this covers cases where the connection is encrypted, but using a broken algorithm. Notably, localhost is considered a secure context, even over HTTP. For more detail on secure contexts, see: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
This commit is contained in:
@@ -91,7 +91,7 @@
|
|||||||
{% block script %}
|
{% block script %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script>
|
<script>
|
||||||
if (window.location.protocol === "http:") {
|
if (!window.isSecureContext) {
|
||||||
// unhide http warning
|
// unhide http warning
|
||||||
var warning = document.getElementById('insecure-login-warning');
|
var warning = document.getElementById('insecure-login-warning');
|
||||||
warning.className = warning.className.replace(/\bhidden\b/, '');
|
warning.className = warning.className.replace(/\bhidden\b/, '');
|
||||||
|
Reference in New Issue
Block a user