mirror of
https://github.com/safing/portbase
synced 2025-09-02 10:40:39 +00:00
Merge pull request #46 from safing/fix/api-auth-error
Fix and improve api authentication error
This commit is contained in:
commit
51a47067bb
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)
|
grantAccess, err := authenticator(server, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("api: authenticator failed: %s", err)
|
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 {
|
if !grantAccess {
|
||||||
log.Warningf("api: denying api access to %s", r.RemoteAddr)
|
log.Warningf("api: denying api access to %s", r.RemoteAddr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue