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

When specifying cookieOptions, the middleware should keep any default setting that wasn't overridden. #41

Open
evert opened this issue May 19, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@evert
Copy link
Member

evert commented May 19, 2022

If a user provides cookieOptions, we throw out all defaults.

  const cookieOptions = options.cookieOptions || {
    path: '/',
    sameSite: 'lax',
    httpOnly: true,
  };

Instead we should keep all defaults and only use values that a user explicitly provided:

  const cookieOptions = {
    path: '/',
    sameSite: 'lax',
    httpOnly: true,
    ...options.cookieOptions
  };

cc @defrex

@evert evert added the enhancement New feature or request label May 19, 2022
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

No branches or pull requests

1 participant