From 7a5c9be1adf200ac65934a1abb028adad273fcbb Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Tue, 25 Jul 2023 15:22:19 +0200 Subject: [PATCH] Fixed Change Password Bug --- home.go | 2 +- login.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/home.go b/home.go index c4f1666..c4b5360 100644 --- a/home.go +++ b/home.go @@ -28,7 +28,7 @@ func handleHome(w http.ResponseWriter, r *http.Request) { can_admin := false if login != nil { - http.Redirect(w, r, "/", http.StatusTemporaryRedirect) + can_admin = login.CanAdmin } data := HomePageData{ diff --git a/login.go b/login.go index 01f6667..7af9d85 100644 --- a/login.go +++ b/login.go @@ -95,6 +95,7 @@ func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo { } templateLogin.Execute(w, data) } + http.Redirect(w, r, "/", http.StatusTemporaryRedirect) return loginInfo } else if r.Method == "GET" {