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

session returned from getIronSessionFromCookieStore does not implement full interface #689

Open
brumm opened this issue Jan 12, 2024 · 1 comment

Comments

@brumm
Copy link

brumm commented Jan 12, 2024

Hey there,

We're using Nextjs's cookies() function. The session object returned from getIronSessionFromCookieStore does not include an implementation for updateConfig.

Our use case for updateConfig is to set a maxAge on the session that is not known until after logging in.

We've worked around this for now by allowing the getSession wrapper around getIronSession to pass new sessionOptions

export async function getSession(
  config: Partial<SessionOptions> = sessionOptions,
) {
  const session = getIronSession<SessionData>(
    cookies(),
    merge({}, sessionOptions, config),
  )
  return session
}
@simpros
Copy link

simpros commented Jan 26, 2024

Same here - i am using v8.0.1

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

No branches or pull requests

2 participants