mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-19 07:30:09 +02:00
refactor: improve error handling and response formatting in API
This commit is contained in:
@@ -53,7 +53,7 @@ func RequireAuth(next http.HandlerFunc) http.HandlerFunc {
|
||||
r = r.WithContext(context.WithValue(r.Context(), nextHandlerContextKey, next))
|
||||
defaultAuth.LoginHandler(w, r)
|
||||
} else {
|
||||
gphttp.ClientError(w, err, http.StatusUnauthorized)
|
||||
gphttp.Unauthorized(w, err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user