diff --git a/docs/content/2.configuration/2.nuxt-config.md b/docs/content/2.configuration/2.nuxt-config.md index 80cc872d..9244e27a 100644 --- a/docs/content/2.configuration/2.nuxt-config.md +++ b/docs/content/2.configuration/2.nuxt-config.md @@ -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]