From cfce7348d430e1f1fb622d94604619280559749f Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 20 Mar 2024 14:30:03 -0400 Subject: [PATCH] fix: move error conditional outside if --- api/middleware/middleware.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/middleware/middleware.go b/api/middleware/middleware.go index 7514b5a..bc52b05 100644 --- a/api/middleware/middleware.go +++ b/api/middleware/middleware.go @@ -168,10 +168,10 @@ func AuthMiddleware(options AuthMiddlewareOptions) func(http.Handler) http.Handl } } + } - if unauthorized { - http.Error(w, err.Error(), http.StatusInternalServerError) - } + if unauthorized { + http.Error(w, err.Error(), http.StatusInternalServerError) } return }