sidebase / nuxt-session

Nuxt session middleware to get a persistent session per app user, e.g., to store data across multiple requests. The nuxt session module provides the useSession() composable out of the box and sets up API endpoints to interact with your session to make working with sessions feel like a breeze.
https://sidebase.io/nuxt-session/
MIT License
188 stars 19 forks source link

Setting expiryInSeconds to null has no effect #38

Closed interpretor closed 1 year ago

interpretor commented 1 year ago

Environment

Reproduction

No response

Describe the bug

  1. In nuxt.config.ts set session.session.expiryInSeconds to null
  2. Start the nuxt application
  3. The moduleOptions in ModuleDefinition<ModuleOptions>.setup will be the default value of 600

Setting expiryInSeconds to another value other than null just works fine.

Additional context

No response

Logs

No response

interpretor commented 1 year ago

Properties with null values aren't copied by defu. As mentioned here, we would need to exchange defu with another module which doesn't ignore null, or change the expiryInSeconds option to use false instead of null.

@BracketJohn What's your opinion?