diff --git a/internal/api/authentication.go b/internal/api/authentication.go index 5a7d1e626..0ff2bcca1 100644 --- a/internal/api/authentication.go +++ b/internal/api/authentication.go @@ -58,9 +58,9 @@ func authenticateHandler(g UserAuthenticator) func(http.Handler) http.Handler { if apiKey != "" { u, err = g.AuthenticateByAPIKey(ctx, apiKey) } else { - userID, err := manager.GetInstance().SessionStore.GetSessionUserID(w, r) - if err != nil { - logger.Errorf("error getting session user ID: %v", err) + userID, getErr := manager.GetInstance().SessionStore.GetSessionUserID(w, r) + if getErr != nil { + logger.Errorf("error getting session user ID: %v", getErr) http.Error(w, "internal server error", http.StatusInternalServerError) return }