diff --git a/templates/login.html b/templates/login.html index 0362902..bb6d190 100644 --- a/templates/login.html +++ b/templates/login.html @@ -5,19 +5,8 @@ // script has run by the time DOMContentLoaded fires, which also makes the // old $(function () { ... }) wrapper redundant. document.addEventListener("DOMContentLoaded", function () { - var host = location.protocol + '//' + window.location.host - var urlParams = new URLSearchParams(window.location.search); - var code = urlParams.get('code'); // Where to go after logging in; validated server-side to a same-site path. var next = {{ .next }}; - - if (code) { - var post = $.post(host + "/api/login", {"code": code}); - post.done(function(data) { - window.location.href = next; - }); - } - var emailForm = $("#email-form"), codeForm = $("#code-form"), status = $("#email-login-status"), change = $("#email-change"); if (!emailForm.length) { return; } @@ -27,7 +16,7 @@ emailForm.on("submit", function (e) { e.preventDefault(); status.text(""); - $.post(host + "/api/login/email", {email: $("#email-input").val()}) + $.post("/api/login/email", {email: $("#email-input").val()}) .done(function () { emailForm.hide(); codeForm.css("display", "flex"); change.show(); status.text("Check your inbox for a 6-digit code."); @@ -38,7 +27,7 @@ codeForm.on("submit", function (e) { e.preventDefault(); status.text(""); - $.post(host + "/api/login/email/verify", {email: $("#email-input").val(), code: $("#code-input").val()}) + $.post("/api/login/email/verify", {email: $("#email-input").val(), code: $("#code-input").val()}) .done(function () { window.location.href = next; }) .fail(function (xhr) { showError(xhr, "Could not verify the code."); }); }); @@ -54,16 +43,10 @@
Log in to manage {{ .settings.site_title.Value }}
- + Continue with GitHub - - {{ if .email_login_enabled }}or sign in with email