From 04e3352e6a6a97ebf8157fba795be18bd8ce5704 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sat, 18 Feb 2023 17:45:44 -0700 Subject: [PATCH] Success not red, go fmt --- cmd/simpleauth/main.go | 2 +- web/login.html | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/simpleauth/main.go b/cmd/simpleauth/main.go index 8733155..f037ceb 100644 --- a/cmd/simpleauth/main.go +++ b/cmd/simpleauth/main.go @@ -64,7 +64,7 @@ func rootHandler(w http.ResponseWriter, req *http.Request) { status = "succeeded" w.Header().Set("X-Simpleauth-Username", username) - if !login { + if !login { // This is the only time simpleauth returns 200 // That will cause Caddy to proceed with the original request http.Error(w, "Success", http.StatusOK) diff --git a/web/login.html b/web/login.html index 5d62fc2..d997e93 100644 --- a/web/login.html +++ b/web/login.html @@ -21,6 +21,9 @@ function error(msg) { document.querySelector("#error").textContent = msg } + function message(msg) { + document.querySelector("#message").textContent = msg + } async function login(evt) { evt.preventDefault() @@ -51,7 +54,7 @@ } document.cookie = cookieStr // JavaScript butt-magic! location.reload() - error("Success - your page should reload now") + message("Logged In!") return } error(req.statusText || "Authentication failed") @@ -72,5 +75,6 @@
+