From 401bd0dac114e19cd9051fd77f4514731c02df21 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Tue, 25 Jul 2023 14:27:58 +0200 Subject: [PATCH] Fixed Change Password Bug --- invite.go | 4 ++++ login.go | 9 --------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/invite.go b/invite.go index ea6d4de..2593ae2 100644 --- a/invite.go +++ b/invite.go @@ -78,6 +78,10 @@ func openNewUserLdap(config *ConfigFile) (*ldap.Conn, error) { func handleLostPassword(w http.ResponseWriter, r *http.Request) { templateLostPasswordPage := getTemplate("password_lost.html") + if checkLogin(w, r) != nil { + http.Redirect(w, r, "/", http.StatusTemporaryRedirect) + } + data := PasswordLostData{ CanAdmin: false, LoggedIn: false, diff --git a/login.go b/login.go index e77c066..2d8edac 100644 --- a/login.go +++ b/login.go @@ -59,15 +59,6 @@ type LoginFormData struct { } func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo { - - loginStatus := checkLogin(w, r) - if loginStatus != nil { - http.Redirect(w, r, "/home", http.StatusSeeOther) - return nil - // handleHome(w, r) - // return loginStatus.Info - } - templateLogin := getTemplate("login.html") if r.Method == "GET" {