vvo/iron-session

session returned from `getIronSessionFromCookieStore` does not implement full interface

brumm opened this issue · 2 comments

brumm commented

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
}

Same here - i am using v8.0.1

vvo commented

Fixes in 8.0.2