mirror of
https://github.com/writeas/writefreely
synced 2025-01-07 13:31:43 +01:00
Remove unnecessary password check on log out
This commit is contained in:
parent
001fc8bb2d
commit
486fb665ad
@ -225,20 +225,11 @@ func viewLogout(app *app, w http.ResponseWriter, r *http.Request) error {
|
|||||||
return impart.HTTPError{http.StatusFound, "/"}
|
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)
|
u, err = app.db.GetUserByID(u.ID)
|
||||||
if err != nil && err != ErrUserNotFound {
|
if err != nil && err != ErrUserNotFound {
|
||||||
return impart.HTTPError{http.StatusInternalServerError, "Unable to fetch user information."}
|
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
|
session.Options.MaxAge = -1
|
||||||
|
|
||||||
err = session.Save(r, w)
|
err = session.Save(r, w)
|
||||||
|
Loading…
Reference in New Issue
Block a user