mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Fix and improve api authentication error
This commit is contained in:
parent
e2d0b39ecb
commit
e83e2b216c
1 changed files with 2 additions and 1 deletions
|
@ -82,7 +82,8 @@ func authMiddleware(next http.Handler) http.Handler {
|
|||
grantAccess, err := authenticator(server, r)
|
||||
if err != nil {
|
||||
log.Warningf("api: authenticator failed: %s", err)
|
||||
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
|
||||
http.Error(w, "Bad Request: Could not identify client", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if !grantAccess {
|
||||
log.Warningf("api: denying api access to %s", r.RemoteAddr)
|
||||
|
|
Loading…
Add table
Reference in a new issue