fix(webui): fix invalid session cookie handling

This commit is contained in:
Julien Dessaux 2025-01-29 00:22:12 +01:00
parent 21c8d6601a
commit ab043d8617
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -29,7 +29,9 @@ func sessionsMiddleware(db *database.DB) func(http.Handler) http.Handler {
errorResponse(w, http.StatusInternalServerError, err)
return
}
if !session.IsExpired() {
if session == nil {
unsetSesssionCookie(w)
} else if !session.IsExpired() {
if err := db.TouchSession(cookie.Value); err != nil {
errorResponse(w, http.StatusInternalServerError, err)
return