Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jfromaniello committed Apr 21, 2022
1 parent 6f8f56c commit bd2515b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ app.use(
);
```

### Multi-tenancy
### Retrieve key dynamically

If you are developing an application in which the secret used to sign tokens is not static, you can provide a callback function as the `secret` parameter. The function has the signature: `function(req, payload, done)`:
If you need to obtain the key dynamically from other sources, you can pass a function in the `secret` parameter with the following parameters:

- `req` (`Object`) - The express `request` object.
- `token` (`Object`) - An object with the JWT payload and headers.

For example, if the secret varies based on the [JWT issuer](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#issDef):
For example, if the secret varies based on the [issuer](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#issDef):

```javascript
var jwt = require("express-jwt");
Expand Down

0 comments on commit bd2515b

Please sign in to comment.