fix(webui): fix invalid session cookie handling
This commit is contained in:
parent
21c8d6601a
commit
ab043d8617
1 changed files with 3 additions and 1 deletions
|
@ -29,7 +29,9 @@ func sessionsMiddleware(db *database.DB) func(http.Handler) http.Handler {
|
||||||
errorResponse(w, http.StatusInternalServerError, err)
|
errorResponse(w, http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !session.IsExpired() {
|
if session == nil {
|
||||||
|
unsetSesssionCookie(w)
|
||||||
|
} else if !session.IsExpired() {
|
||||||
if err := db.TouchSession(cookie.Value); err != nil {
|
if err := db.TouchSession(cookie.Value); err != nil {
|
||||||
errorResponse(w, http.StatusInternalServerError, err)
|
errorResponse(w, http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue