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
* How to extract the session-data from the session response.
264
+
*
265
+
* E.g., setting this to `/data/user` and returning an object like `{ data: { user: { id:number, name: string } }, status: 'ok' }` from the `getSession` endpoint will
266
+
* storing the 'User' object typed as the type created via the 'dataType' prop.
267
+
*
268
+
* This follows the JSON Pointer standard, see it's RFC6901 here: https://www.rfc-editor.org/rfc/rfc6901
269
+
*
270
+
* @default/ Access the root of the session response object
271
+
* @example/data/user Access the `data/user` property of the session response object
272
+
*/
273
+
dataResponsePointer?:string;
274
+
}
258
275
}
259
276
260
277
```
@@ -406,7 +423,7 @@ type ProviderRefresh = {
406
423
* @default'/refreshToken' Access the `refreshToken` property of the sign-in response object
407
424
* @example/ Access the root of the sign-in response object, useful when your endpoint returns a plain, non-object string as the refreshToken
408
425
*/
409
-
signInResponseRefreshTokenPointer?:string
426
+
signInResponseRefreshTokenPointer?:string,
410
427
/**
411
428
* How to do a fetch for the refresh token.
412
429
*
@@ -445,14 +462,31 @@ type ProviderRefresh = {
445
462
*/
446
463
cookieDomain?:string;
447
464
},
448
-
/**
449
-
* Define an interface for the session data object that `nuxt-auth` expects to receive from the `getSession` endpoint.
* How to extract the session-data from the session response.
479
+
*
480
+
* E.g., setting this to `/data/user` and returning an object like `{ data: { user: { id:number, name: string } }, status: 'ok' }` from the `getSession` endpoint will
481
+
* storing the 'User' object typed as the type created via the 'dataType' prop.
482
+
*
483
+
* This follows the JSON Pointer standard, see it's RFC6901 here: https://www.rfc-editor.org/rfc/rfc6901
484
+
*
485
+
* @default/ Access the root of the session response object
486
+
* @example/data/user Access the `data/user` property of the session response object
487
+
*/
488
+
dataResponsePointer?:string;
489
+
}
456
490
}
457
491
```
458
492
```ts [SessionConfig]
@@ -471,7 +505,7 @@ type SessionConfig = {
471
505
* @defaultfalse
472
506
*
473
507
*/
474
-
enableRefreshPeriodically:number|boolean
508
+
enableRefreshPeriodically:number|boolean,
475
509
/**
476
510
* Whether to refresh the session every time the browser window is refocused.
Copy file name to clipboardExpand all lines: content/2.nuxt-auth/3.application-side/2.session-access-and-management.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ inferface SessionData {
186
186
id: string|number
187
187
}
188
188
189
-
// Option B: You configured `auth.provider.sessionDataType` to something like ` { id: 'string', email: 'string', name: 'string', role: 'admin | guest | account' }`
189
+
// Option B: You configured `auth.provider.session.dataType` to something like ` { id: 'string', email: 'string', name: 'string', role: 'admin | guest | account' }`
190
190
inferfaceSessionData {
191
191
id: string
192
192
email: string
@@ -196,7 +196,7 @@ inferface SessionData {
196
196
```
197
197
::
198
198
199
-
### About `auth.provider.sessionDataType`
199
+
### About `auth.provider.session.dataType`
200
200
201
201
This is a configuration option available to dynamically type the `SessionData` that the `local` provider will return when accessing `data.value`. Read more about this in the [nuxt.config.ts configuration documentation](/nuxt-auth/v0.6/configuration/nuxt-config) of the `local` provider.
0 commit comments