Remove unnecessary password check on log out

This commit is contained in:
Matt Baer 2018-11-09 22:12:18 -05:00
parent 001fc8bb2d
commit 486fb665ad
1 changed files with 0 additions and 9 deletions

View File

@ -225,20 +225,11 @@ func viewLogout(app *app, w http.ResponseWriter, r *http.Request) error {
return impart.HTTPError{http.StatusFound, "/"}
}
passIsSet, err := app.db.IsUserPassSet(u.ID)
if err != nil {
log.Error("IsUserPassSet err: %v", err)
return ErrInternalCookieSession
}
u, err = app.db.GetUserByID(u.ID)
if err != nil && err != ErrUserNotFound {
return impart.HTTPError{http.StatusInternalServerError, "Unable to fetch user information."}
}
if !passIsSet && u.Email.String == "" {
return impart.HTTPError{http.StatusFound, "/me/settings?logout=1"}
}
session.Options.MaxAge = -1
err = session.Save(r, w)