From fb7240f07470dde96c35556504911316f65d22bd Mon Sep 17 00:00:00 2001 From: elraphty Date: Tue, 5 Mar 2024 19:52:29 +0100 Subject: [PATCH] added response for auth --- handlers/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers/auth.go b/handlers/auth.go index dd60960ef..bd46a4040 100644 --- a/handlers/auth.go +++ b/handlers/auth.go @@ -44,8 +44,8 @@ func (ah *authHandler) GetIsAdmin(w http.ResponseWriter, r *http.Request) { isAdmin := auth.AdminCheck(pubKeyFromAuth) if !auth.IsFreePass() && !isAdmin { - fmt.Println("Not a super admin: handler") - http.Error(w, http.StatusText(401), 401) + w.WriteHeader(http.StatusUnauthorized) + json.NewEncoder(w).Encode("Not a super admin: handler") return } else { w.WriteHeader(http.StatusOK)