add readme for exceptions
This commit is contained in:
parent
0d782e91c5
commit
f73d4f7ec1
@ -31,3 +31,12 @@ app.use(auth((user_name) => {
|
||||
|
||||
when a client logs in, it will set a header called 'session' that the client can use to authorize the following requests.
|
||||
it also sets a cookie to make requesting from the client more simple. (cookie parser is needed to make authentication with cookies possible)
|
||||
|
||||
## Excluding routes
|
||||
|
||||
exceptions to the auth module can be added by adding an array of regular expressions
|
||||
a specific method can also be filtered for by giving an object instead of a plain regular expression.
|
||||
|
||||
```js
|
||||
auth(..., [/no-auth/, {regex: '/no-auth-post/', method: 'POST'}]);
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user