Skip to content

Commit

Permalink
fix: wrong default cookieMaxAge
Browse files Browse the repository at this point in the history
fixes #181
  • Loading branch information
Sandros94 committed Aug 10, 2023
1 parent 7b3633a commit 3dd4783
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/content/1.getting-started/2.options.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ The function that get called if the `autoRefresh` fail

## `cookieMaxAge`

- Default: `604800`
- Default: `604800000`

Need to be the same as specified in your directus config; this is the max amount of milliseconds that your refresh cookie will be kept in the browser.
Need to be the same as specified in your directus env config ([defaults to `7d`](https://docs.directus.io/self-hosted/config-options.html#security)); this is the max amount of milliseconds that your refresh cookie will be kept in the browser. This value could be configured in a more *human readable* way as `7 * 24 * 60 * 60 * 1000`.

Auto refesh tokens

Expand Down
10 changes: 5 additions & 5 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ export interface ModuleOptions {
cookieNameRefreshToken?: string;

/**
* The max age for auth cookies in seconds.
* The max age for auth cookies in milliseconds.
* This should match your directus env key REFRESH_TOKEN_TTL
* @type string
* @default 604800
* @default 604800000
*/
cookieMaxAge?: number;

/**
* The max age for auth cookies in seconds.
* The max age for auth cookies in milliseconds.
* This should match your directus env key REFRESH_TOKEN_TTL
* @type string
* @default 604800
* @default 604800000
*/
maxAgeRefreshToken?: number;

Expand Down Expand Up @@ -108,7 +108,7 @@ export default defineNuxtModule<ModuleOptions>({
cookieNameRefreshToken: 'directus_refresh_token',

// Nuxt Cookies Docs @ https://nuxt.com/docs/api/composables/use-cookie
cookieMaxAge: 604800,
cookieMaxAge: 604800000,
cookieSameSite: 'lax',
cookieSecure: false
},
Expand Down

0 comments on commit 3dd4783

Please sign in to comment.