Remove unnecessary password check on log out

pull/24/head
Matt Baer 6 years ago
parent 001fc8bb2d
commit 486fb665ad
  1. 9
      account.go

@ -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)

Loading…
Cancel
Save