Skip to content

Commit

Permalink
Clear authenticated session if unable to read cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash committed Feb 27, 2024
1 parent 65cf377 commit 392876d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/api/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ func handleLogout(w http.ResponseWriter, r *http.Request) {
func getSessionUserID(w http.ResponseWriter, r *http.Request) (string, error) {
session, err := sessionStore.Get(r, cookieName)
if err != nil {
return "", err
session.Options.MaxAge = -1
session.Save(r, w)

Check failure on line 84 in pkg/api/session.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `session.Save` is not checked (errcheck)
return "", nil
}

if !session.IsNew {
Expand Down

0 comments on commit 392876d

Please sign in to comment.