Skip to content

Commit 8b903bd

Browse files
authored
🔄 synced local 'content/2.nuxt-auth/' with remote 'docs/content/' (#185)
Co-authored-by: sideborg <null>
1 parent fbdce22 commit 8b903bd

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

content/2.nuxt-auth/2.configuration/2.nuxt-config.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ interface ModuleOptions {
6666
provider?: AuthProviders
6767
/**
6868
* Configuration of the application-side session. You can configure the following attributes:
69-
* - enableRefreshPeriodically: Whether to refresh the session every `X` milliseconds. Set this to `false` to turn it off. The session will only be refreshed if a session already exists. Setting this to `true` will refresh the session every second. Setting this to `false` will turn off session refresh. Setting this to a number `X` will refresh the session every `X` milliseconds.
70-
* - enableRefreshOnWindowFocus: Whether to refresh the session every time the browser window is refocused.
69+
* - enablePeriodically: Whether to refresh the session every `X` milliseconds. Set this to `false` to turn it off. The session will only be refreshed if a session already exists. Setting this to `true` will refresh the session every second. Setting this to `false` will turn off session refresh. Setting this to a number `X` will refresh the session every `X` milliseconds.
70+
* - enableOnWindowFocus: Whether to refresh the session every time the browser window is refocused.
7171
*
72-
* @example { enableRefreshPeriodically: 5000 }
73-
* @example { enableRefreshOnWindowFocus: false }
74-
* @default { enableRefreshPeriodically: false, enableRefreshOnWindowFocus: true }
72+
* @example { enablePeriodically: 5000 }
73+
* @example { enableOnWindowFocus: false }
74+
* @default { enablePeriodically: false, enableOnWindowFocus: true }
7575
*/
76-
session?: SessionConfig
76+
sessionRefresh?: SessionRefreshConfig
7777
/**
7878
* Whether to add a global authentication middleware that protects all pages. Can be either `false` to disable, `true` to enabled
7979
* or an object to enable and apply extended configuration.
@@ -505,11 +505,11 @@ type ProviderRefresh = {
505505
}
506506
}
507507
```
508-
```ts [SessionConfig]
508+
```ts [SessionRefreshConfig]
509509
/**
510510
* Configuration for the application-side session.
511511
*/
512-
type SessionConfig = {
512+
type SessionRefreshConfig = {
513513
/**
514514
* Whether to refresh the session every `X` milliseconds. Set this to `false` to turn it off. The session will only be refreshed if a session already exists.
515515
*
@@ -521,22 +521,22 @@ type SessionConfig = {
521521
* @default false
522522
*
523523
*/
524-
enableRefreshPeriodically: number | boolean,
524+
enablePeriodically: number | boolean,
525525
/**
526526
* Whether to refresh the session every time the browser window is refocused.
527527
*
528528
* @example false
529529
* @default true
530530
*/
531-
enableRefreshOnWindowFocus: boolean
531+
enableOnWindowFocus: boolean
532532
/**
533533
* A custom refresh handler to use. This can be used to implement custom session refresh logic.
534534
* If not set, the default refresh handler will be used.
535535
*
536536
* @example ./src/runtime/utils/refreshHandler.ts
537537
* @default undefined
538538
*/
539-
refreshHandler?: RefreshHandler;
539+
handler?: RefreshHandler;
540540
}
541541
```
542542
```ts [GlobalMiddlewareOptions]

content/2.nuxt-auth/2.configuration/5.session-config.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Use this section to configure the application-side session. The following type d
66
/**
77
* Configuration for the application-side session.
88
*/
9-
type SessionConfig = {
9+
type SessionRefreshConfig = {
1010
/**
1111
* Whether to refresh the session every `X` milliseconds. Set this to `false` to turn it off. The session will only be refreshed if a session already exists.
1212
*
@@ -18,38 +18,38 @@ type SessionConfig = {
1818
* @default false
1919
*
2020
*/
21-
enableRefreshPeriodically: number | boolean
21+
enablePeriodically: number | boolean
2222
/**
2323
* Whether to refresh the session every time the browser window is refocused.
2424
*
2525
* @example false
2626
* @default true
2727
*/
28-
enableRefreshOnWindowFocus: boolean
28+
enableOnWindowFocus: boolean
2929
/**
3030
* A custom refresh handler to use. This can be used to implement custom session refresh logic.
3131
* If not set, the default refresh handler will be used.
3232
*
3333
* @example ./src/runtime/utils/refreshHandler.ts
3434
* @default undefined
3535
*/
36-
refreshHandler?: RefreshHandler;
36+
handler?: RefreshHandler;
3737
}
3838
```
3939
4040
## Application side session
4141
42-
Per default nuxt-auth will use the set values for `enableRefreshPeriodically` & `enableRefreshOnWindowFocus` to refresh your application-side session. If you don't provide a configuration nuxt-auth won't trigger a job that refreshes the session periodically but it will always refresh the session if the window is refocussed.
42+
Per default nuxt-auth will use the set values for `enablePeriodically` & `enableOnWindowFocus` to refresh your application-side session. If you don't provide a configuration nuxt-auth won't trigger a job that refreshes the session periodically but it will always refresh the session if the window is refocussed.
4343
44-
If you set `enableRefreshPeriodically` simply to true a job will be run every second (1000ms) that will fetch your specified `getSession` endpoint. You can customize the interval if you provide a number instead of a boolean value.
44+
If you set `enablePeriodically` simply to true a job will be run every second (1000ms) that will fetch your specified `getSession` endpoint. You can customize the interval if you provide a number instead of a boolean value.
4545
46-
To disable the session refresh when the window is refocussed simply set `enableRefreshOnWindowFocus` to `false`.
46+
To disable the session refresh when the window is refocussed simply set `enableOnWindowFocus` to `false`.
4747
4848
## Using a custom RefreshHandler
4949
5050
To customize the session refreshing you can provide a refresh handler. A custom `RefreshHandler` requires an `init`- and a `destroy`-function.
5151
52-
`init` will be called when the nuxt application is mounted. Here you may add event listeners and initialize custom refresh behaviour. The method will receive a `RefreshHandlerConfig`. The type consists of `enableRefreshPeriodically` & `enableRefreshOnWindowFocus`.
52+
`init` will be called when the nuxt application is mounted. Here you may add event listeners and initialize custom refresh behaviour. The method will receive a `RefreshHandlerConfig`. The type consists of `enablePeriodically` & `enableOnWindowFocus`.
5353
5454
`destroy` will be called when your app is unmounted. Here you may run your clean up routine e.g. to remove your event listeners.
5555

0 commit comments

Comments
 (0)