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

fix(cookie): Use the shop cookie name for default route #2839

Conversation

alexisvigoureux
Copy link
Contributor

@alexisvigoureux alexisvigoureux commented May 7, 2024

Description

In addition to this PR
#2482

Here is the cookie naming behavior:

  • If not setting the authOptions.cookieOptions.name parameter:
    • Both the Admin API and Shop API cookies names will be the default one: 'session'
  • If setting the authOptions.cookieOptions.name parameter to something like 'cookie-name':
    • Both the Admin API and Shop API cookies names will be the configured one: 'cookie-name'
  • If setting the authOptions.cookieOptions.name parameter to something like {shop: 'cookie-name', admin: 'admin-cookie-name'}:
    • The Admin API cookie name will be 'admin-cookie-name'
    • Shop API cookie name will be 'cookie-name'
    • And all the REST endpoints on the / route will use the default cookie: 'session'
      • context: some systems do not support Graphql and so we have a few REST endpoints. This PR allows to use the same shop cookie name for graphql and REST routes

Breaking changes

I think it's an unintended behaviour that can be released in the next patch

Screenshots

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

Copy link

netlify bot commented May 7, 2024

Deploy Preview for effervescent-donut-4977b2 failed.

Name Link
🔨 Latest commit 0a657e0
🔍 Latest deploy log https://app.netlify.com/sites/effervescent-donut-4977b2/deploys/6639eded7e2e4300096ff148

@michaelbromley michaelbromley merged commit 429f88d into vendure-ecommerce:master May 8, 2024
11 of 16 checks passed
@michaelbromley
Copy link
Member

Thanks!

@alexisvigoureux alexisvigoureux deleted the fix-cookie-name-on-rest-route branch May 8, 2024 07:02
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

Successfully merging this pull request may close these issues.

2 participants