Refactoring
This commit is contained in:
parent
2a9c186c9a
commit
b536e30ce1
1 changed files with 9 additions and 7 deletions
16
session.go
16
session.go
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue