update readme
This commit is contained in:
@@ -101,10 +101,14 @@ Returns token as a `string`.
|
|||||||
Verifies the integrity of the token and returns a boolean value.
|
Verifies the integrity of the token and returns a boolean value.
|
||||||
|
|
||||||
Argument | Type | Status | Default | Description
|
Argument | Type | Status | Default | Description
|
||||||
----------- | -------- | -------- | ------- | -----------
|
------------------------ | ------------------ | -------- | ------- | -----------
|
||||||
`token` | `string` | required | - | The token string generated by `jwt.sign()`.
|
`token` | `string` | required | - | The token string generated by `jwt.sign()`.
|
||||||
`secret` | `string` | required | - | The string which was used to sign the payload.
|
`secret` | `string` | required | - | The string which was used to sign the payload.
|
||||||
`options` | `object` | optional | `{ algorithm: 'HS256', skipValidation: false, throwError: false }` | The options object supporting `algorithm`, `skipValidation` and `throwError`. (See [Available Algorithms](#available-algorithms))
|
`options` | `string`, `object` | optional | `HS256` | Either the `algorithm` string or an object.
|
||||||
|
`options.algorithm` | `string` | optional | `HS256` | See [Available Algorithms](#available-algorithms)
|
||||||
|
`options.clockTolerance` | `number` | optional | `0` | Clock tolerance in seconds, to help with slighly out of sync systems.
|
||||||
|
`options.throwError` | `boolean` | optional | `false` | By default this we will only throw implementation errors, only set this to `true` if you want verification errors to be thrown as well.
|
||||||
|
|
||||||
|
|
||||||
#### `throws`
|
#### `throws`
|
||||||
If `options.throwError` is `true` and the token is invalid, an error will be thrown.
|
If `options.throwError` is `true` and the token is invalid, an error will be thrown.
|
||||||
|
|||||||
Reference in New Issue
Block a user