Skip to content

Commit 08a7cc6

Browse files
author
Leon Strauss
committed
documented that req.auth is added regardless of approval
1 parent 9b8c887 commit 08a7cc6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ The middleware will now check incoming requests to match the credentials
3030
`admin:supersecret`.
3131

3232
The middleware will check incoming requests for a basic auth (`Authorization`)
33-
header, parse it and check if the credentials are legit.
33+
header, parse it and check if the credentials are legit. If there are any
34+
credentials, an `auth` property will be added to the request, containing
35+
an object with `user` and `password` properties, filled with the credentials,
36+
no matter if they are legit or not.
3437

3538
**If a request is found to not be authorized**, it will respond with HTTP 401
3639
and a configurable (default empty) body.
3740

38-
**If a request is successfully authorized**, an `auth` property will be added to the request,
39-
containing an object with `user` and `password` properties, filled with the credentials.
40-
4141
### Static Users
4242

4343
If you simply want to check basic auth against one or multiple static credentials,

0 commit comments

Comments
 (0)