Skip to content

Commit

Permalink
docs: add session data type to the refresh docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Hutter authored and Valentin Hutter committed Jan 9, 2024
1 parent 6fade21 commit d596f39
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/content/2.configuration/2.nuxt-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,31 @@ type ProviderRefresh = {
*/
maxAgeInSeconds?: number,
},
/*
* Settings for the session-data that `nuxt-auth` receives from the `getSession` endpoint.
*/
session?: {
/**
* Define an interface for the session data object that `nuxt-auth` expects to receive from the `getSession` endpoint.
*
* @default { id: 'string | number' }
* @example { id: 'string', name: 'string', email: 'string' }
* @advanced_array_example { id: 'string', email: 'string', name: 'string', role: 'admin | guest | account', subscriptions: "{ id: number, status: 'ACTIVE' | 'INACTIVE' }[]" }
*/
dataType?: SessionDataObject;
/**
* How to extract the session-data from the session response.
*
* 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
* storing the 'User' object typed as the type created via the 'dataType' prop.
*
* This follows the JSON Pointer standard, see it's RFC6901 here: https://www.rfc-editor.org/rfc/rfc6901
*
* @default / Access the root of the session response object
* @example /data/user Access the `data/user` property of the session response object
*/
dataResponsePointer?: string;
}
}
```
```ts [SessionConfig]
Expand Down

0 comments on commit d596f39

Please sign in to comment.