Return 401 code for ErrUnauthorized (#4842)

This commit is contained in:
damontecres 2024-05-16 00:30:19 -04:00 committed by GitHub
parent ca5febc65b
commit ad844a225c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,7 +42,7 @@ func authenticateHandler() func(http.Handler) http.Handler {
userID, err := manager.GetInstance().SessionStore.Authenticate(w, r) userID, err := manager.GetInstance().SessionStore.Authenticate(w, r)
if err != nil { if err != nil {
if errors.Is(err, session.ErrUnauthorized) { if !errors.Is(err, session.ErrUnauthorized) {
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
return return
} }