LionC / express-basic-auth

Plug & play basic auth middleware for express
325 stars 57 forks source link

Change wrong authorization http code to 403 #43

Closed coffeeispower closed 2 years ago

coffeeispower commented 2 years ago

401 is used to say that the authorization header wasn't provided: https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Status/401
403 is used when the password is wrong: https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Status/403

So i corrected just for the standards I'm using this library with git-http-backend, and git is not recognizing that the user/password is incorrect, because its returning the wrong error code