Refactoring

This commit is contained in:
Chris Mann 2023-07-26 08:53:29 +02:00
parent 2a9c186c9a
commit b536e30ce1

View file

@ -162,13 +162,15 @@ func logout(w http.ResponseWriter, r *http.Request) error {
session, err := store.Get(r, SESSION_NAME)
if err != nil {
session, _ = store.New(r, SESSION_NAME)
return err
// return err
} else {
delete(session.Values, "login_username")
delete(session.Values, "login_password")
delete(session.Values, "login_dn")
err = session.Save(r, w)
}
delete(session.Values, "login_username")
delete(session.Values, "login_password")
delete(session.Values, "login_dn")
err = session.Save(r, w)
return err
// return err
return nil
}