From 095b1d43f3d641467c513b7622cb858b4f8efff0 Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Sat, 4 Jun 2022 17:42:33 +0200 Subject: [PATCH] Update docs --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1612a3e..5c9dc48 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,10 @@ Argument | Type | Satus | Default | Description ----------- | -------- | -------- | ------- | ----------- `token` | `string` | required | - | The token string generated by `jwt.sign()`. `secret` | `string` | required | - | The string which was used to sign the payload. -`algorithm` | `object`, `string` | optional | `{ algorithm: 'HS256', throwError: false }` | The options object supporting `algorithm` or just the algorithm string. (See [Available Algorithms](#available-algorithms)) +`options` | `object`, `string` | optional | `{ algorithm: 'HS256', throwError: false }` | The options object supporting `algorithm` or just the algorithm string. (See [Available Algorithms](#available-algorithms)) + +#### `throws` +If `options.throwError` is `true` and the token is invalid, an error will be thrown. #### `return` Returns `true` if signature, `nbf` (if set) and `exp` (if set) are valid, otherwise returns `false`.