feat: improve responses

This commit is contained in:
Siesta
2025-07-27 22:57:43 +02:00
parent aa7d36158d
commit cc317ca661
5 changed files with 56 additions and 48 deletions
+3 -3
View File
@@ -11,9 +11,9 @@ func WithAdminAuth(handlerFunc http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("Authorization")
if !db.IsAdmin(token) {
utils.HTTPResponseHandler(w, r, http.StatusUnauthorized, "Invalid token")
return
utils.ErrorResponse(w, http.StatusUnauthorized, "Invalid token")
return
}
handlerFunc(w, r)
}
}
}