Skip to content

Commit

Permalink
docs: add token and refresh token maxAge
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroAS51 committed Mar 13, 2020
1 parent 1d1716f commit 29db19f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/schemes/local.md
Expand Up @@ -103,6 +103,15 @@ Authorization header name to be used in axios requests.

Authorization header type to be used in axios requests.

#### `maxAge`

- Default: `1800`

Here you set the expiration time of the token, in **seconds**.
This time will be used if for some reason we couldn't decode the token to get the expiration date.

Default time is 30 minutes.

### `user`

Here you configure the user options.
Expand Down
24 changes: 22 additions & 2 deletions docs/schemes/oauth2.md
Expand Up @@ -24,10 +24,12 @@ auth: {
},
token: {
property: 'access_token',
type: 'Bearer'
type: 'Bearer',
maxAge: 1800
},
refreshToken: {
property: 'refresh_token'
property: 'refresh_token',
maxAge: 60 * 60 * 24 * 30
},
responseType: 'token',
accessType: undefined,
Expand Down Expand Up @@ -69,12 +71,30 @@ By default is set to `property: 'access_token'`. If you need to use the IdToken

By default is `Bearer`. It will be used in `Authorization` header of axios requests.

#### `maxAge`

- Default: `1800`

Here you set the expiration time of the token, in **seconds**.
This time will be used if for some reason we couldn't decode the token to get the expiration date.

Default time is 30 minutes.

### `refreshToken`

#### `property`

By default is set to `property: 'refresh_token'`. It automatically store the refresh_token, if it exists.

#### `maxAge`

- Default: `60 * 60 * 24 * 30`

Here you set the expiration time of the refresh token, in **seconds**.
This time will be used if for some reason we couldn't decode the token to get the expiration date.

Default time is 30 days.

### `responseType`

By default is `token`. If you use `code` you may have to implement a server side logic to sign the response code.
Expand Down

0 comments on commit 29db19f

Please sign in to comment.