fixed a bug that stopped sessions from being deleted

This commit is contained in:
Gregory Wells
2026-03-25 10:20:20 -04:00
parent ffb4077f24
commit f491c80fa0
3 changed files with 18 additions and 3 deletions

View File

@@ -57,6 +57,7 @@ func createUserPhoto(username string, photoData []byte) error {
}
func authenticateUser(username, password string) (UserData, error) {
logging.Event(logging.AuthenticateUser, username)
ldapServerMutex.Lock()
defer ldapServerMutex.Unlock()
if ldapServer.Connection == nil {
@@ -232,9 +233,7 @@ func logoutHandler(w http.ResponseWriter, r *http.Request) {
}
}
sessionMutex.Lock()
delete(sessions, token)
sessionMutex.Unlock()
deleteSession(token)
http.Redirect(w, r, "/login", http.StatusSeeOther)
}