You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/2.nuxt-auth/2.configuration/2.nuxt-config.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -66,14 +66,14 @@ interface ModuleOptions {
66
66
provider?:AuthProviders
67
67
/**
68
68
* 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.
* Whether to add a global authentication middleware that protects all pages. Can be either `false` to disable, `true` to enabled
79
79
* or an object to enable and apply extended configuration.
@@ -505,11 +505,11 @@ type ProviderRefresh = {
505
505
}
506
506
}
507
507
```
508
-
```ts [SessionConfig]
508
+
```ts [SessionRefreshConfig]
509
509
/**
510
510
* Configuration for the application-side session.
511
511
*/
512
-
typeSessionConfig= {
512
+
typeSessionRefreshConfig= {
513
513
/**
514
514
* 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.
515
515
*
@@ -521,22 +521,22 @@ type SessionConfig = {
521
521
* @defaultfalse
522
522
*
523
523
*/
524
-
enableRefreshPeriodically:number|boolean,
524
+
enablePeriodically:number|boolean,
525
525
/**
526
526
* Whether to refresh the session every time the browser window is refocused.
527
527
*
528
528
* @examplefalse
529
529
* @defaulttrue
530
530
*/
531
-
enableRefreshOnWindowFocus:boolean
531
+
enableOnWindowFocus:boolean
532
532
/**
533
533
* A custom refresh handler to use. This can be used to implement custom session refresh logic.
534
534
* If not set, the default refresh handler will be used.
Copy file name to clipboardExpand all lines: content/2.nuxt-auth/2.configuration/5.session-config.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Use this section to configure the application-side session. The following type d
6
6
/**
7
7
* Configuration for the application-side session.
8
8
*/
9
-
typeSessionConfig= {
9
+
typeSessionRefreshConfig= {
10
10
/**
11
11
* 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.
12
12
*
@@ -18,38 +18,38 @@ type SessionConfig = {
18
18
* @defaultfalse
19
19
*
20
20
*/
21
-
enableRefreshPeriodically:number|boolean
21
+
enablePeriodically:number|boolean
22
22
/**
23
23
* Whether to refresh the session every time the browser window is refocused.
24
24
*
25
25
* @examplefalse
26
26
* @defaulttrue
27
27
*/
28
-
enableRefreshOnWindowFocus:boolean
28
+
enableOnWindowFocus:boolean
29
29
/**
30
30
* A custom refresh handler to use. This can be used to implement custom session refresh logic.
31
31
* If not set, the default refresh handler will be used.
32
32
*
33
33
* @example./src/runtime/utils/refreshHandler.ts
34
34
* @defaultundefined
35
35
*/
36
-
refreshHandler?:RefreshHandler;
36
+
handler?:RefreshHandler;
37
37
}
38
38
```
39
39
40
40
## Application side session
41
41
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.
43
43
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.
45
45
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`.
47
47
48
48
## Using a custom RefreshHandler
49
49
50
50
To customize the session refreshing you can provide a refresh handler. A custom `RefreshHandler` requires an `init`- and a `destroy`-function.
51
51
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`.
53
53
54
54
`destroy` will be called when your app is unmounted. Here you may run your clean up routine e.g. to remove your event listeners.
0 commit comments