Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔄 synced file(s) with sidebase/nuxt-auth #176

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion content/2.nuxt-auth/2.configuration/2.nuxt-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ interface ModuleOptions {
*/
provider?: AuthProviders
/**
* Configuration of the application-side session.
* Configuration of the application-side session. You can configure the following attributes:
* - 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.
* - enableRefreshOnWindowFocus: Whether to refresh the session every time the browser window is refocused.
*
* @example { enableRefreshPeriodically: 5000 }
* @example { enableRefreshOnWindowFocus: false }
* @default { enableRefreshPeriodically: false, enableRefreshOnWindowFocus: true }
*/
session?: SessionConfig
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ await getSession({ force: true })
```
::

## Automatic session refreshing
To activate or deactivate a periodical session refresh or session refresh when refocusing the window, please consult the [nuxt.config.ts configuration documentation](/nuxt-auth/configuration/nuxt-config) of the `session` object.

## Redirects

You can also pass the `callbackUrl` option to both the `signIn`, the `signOut` and the `getSession` methods. This allows you to redirect a user to a certain pages, after they've completed the action. This can be useful when a user attempts to open a page (`/protected`) but has to go through external authentication (e.g., via their google account) first.
Expand Down
Loading