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" {