Skip to content

Commit 928a45e

Browse files
author
Leon Strauss
committed
added README and gitignore
1 parent e06a9b6 commit 928a45e

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
*.log
3+
server.js

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ The middleware will now check incoming requests to match the credentials
1919

2020
## How it behaves
2121

22+
The middleware will check incoming requests for a basic auth (`Authorization`)
23+
header, parse it and check if the credentials are legit.
24+
25+
**If a request is found to not be authorized**, it will respond with HTTP 401 and an empty body.
26+
27+
**If a request is successfully authorized**, an `auth` property will be added to the request,
28+
containing an object with `user` and `password` properties, filled with the credentials.
29+
2230
If you simply want to check basic auth against one or multiple static credentials,
2331
you can simply pass the credentials as in the example above:
2432

0 commit comments

Comments
 (0)