Skip to content

Commit cd33cc8

Browse files
ziluvatarjstrutz
authored andcommittedMay 23, 2018
add some clarifications (#473)
1 parent c8ff7b2 commit cd33cc8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ $ npm install jsonwebtoken
2525

2626
(Synchronous) Returns the JsonWebToken as string
2727

28-
`payload` could be an object literal, buffer or string representing valid JSON. *Please note that* `exp` is only set if the payload is an object literal. Buffer or string payloads are not checked for JSON validity.
28+
`payload` could be an object literal, buffer or string representing valid JSON. *Please note that* `exp` or any other claim is only set if the payload is an object literal. Buffer or string payloads are not checked for JSON validity.
2929

3030
`secretOrPrivateKey` is a string, buffer, or object containing either the secret for HMAC algorithms or the PEM
3131
encoded private key for RSA and ECDSA. In case of a private key with passphrase an object `{ key, passphrase }` can be used (based on [crypto documentation](https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format)), in this case be sure you pass the `algorithm` option.
3232

3333
`options`:
3434

3535
* `algorithm` (default: `HS256`)
36-
* `expiresIn`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). Eg: `60`, `"2 days"`, `"10h"`, `"7d"`
37-
* `notBefore`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). Eg: `60`, `"2 days"`, `"10h"`, `"7d"`
36+
* `expiresIn`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). Eg: `60`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`).
37+
* `notBefore`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). Eg: `60`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`).
3838
* `audience`
3939
* `issuer`
4040
* `jwtid`
@@ -134,7 +134,7 @@ As mentioned in [this comment](https://github.com/auth0/node-jsonwebtoken/issues
134134
* `ignoreNotBefore`...
135135
* `subject`: if you want to check subject (`sub`), provide a value here
136136
* `clockTolerance`: number of seconds to tolerate when checking the `nbf` and `exp` claims, to deal with small clock differences among different servers
137-
* `maxAge`: the maximum allowed age for tokens to still be valid. It is expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). Eg: `1000`, `"2 days"`, `"10h"`, `"7d"`.
137+
* `maxAge`: the maximum allowed age for tokens to still be valid. It is expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms). Eg: `1000`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`).
138138
* `clockTimestamp`: the time in seconds that should be used as the current time for all necessary comparisons.
139139

140140

0 commit comments

Comments
 (0)
Please sign in to comment.