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

setUserSession specify max age #169

Closed
jaketig opened this issue Sep 10, 2024 · 1 comment · Fixed by #171
Closed

setUserSession specify max age #169

jaketig opened this issue Sep 10, 2024 · 1 comment · Fixed by #171
Labels
enhancement New feature or request

Comments

@jaketig
Copy link

jaketig commented Sep 10, 2024

Is there any way to pass maxAge when calling setUserSession instead of globally in nuxt.config?

My login endpoint validates user credentails against a pre-existing internal only SSO service.
That service is returning the same token/expiration if a user logs in more than once
I store that token in my user data with setUserSession and use it to call other services server side later on.
I would like to be able to match the expiration of the session with the token expiration.

@atinux
Copy link
Owner

atinux commented Sep 11, 2024

It's now possible with v0.3.8:

await setUserSession(event, { ... } , {
  maxAge: 60 * 60 * 24 * 7 // 1 week
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants