From ad844a225c83ba22817da9d768c095258576f932 Mon Sep 17 00:00:00 2001 From: damontecres <154766448+damontecres@users.noreply.github.com> Date: Thu, 16 May 2024 00:30:19 -0400 Subject: [PATCH] Return 401 code for ErrUnauthorized (#4842) --- internal/api/authentication.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/authentication.go b/internal/api/authentication.go index 94b5328f5..00ef58e5e 100644 --- a/internal/api/authentication.go +++ b/internal/api/authentication.go @@ -42,7 +42,7 @@ func authenticateHandler() func(http.Handler) http.Handler { userID, err := manager.GetInstance().SessionStore.Authenticate(w, r) if err != nil { - if errors.Is(err, session.ErrUnauthorized) { + if !errors.Is(err, session.ErrUnauthorized) { http.Error(w, err.Error(), http.StatusInternalServerError) return }