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

mpId compatibility with headless shops #32

Open
indykoning opened this issue Jan 2, 2023 · 0 comments
Open

mpId compatibility with headless shops #32

indykoning opened this issue Jan 2, 2023 · 0 comments

Comments

@indykoning
Copy link

Currently the mpId on an order can only be set via cookies at the moment a cart is being created.
This causes trouble if your frontend is running on another (sub)domain for e.g. headless frontends.

Setting a cookie in this frontend has no effect on the backend, and trying to pass this cookie with e.g. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials is a security concern and violates CORS in most cases.

My suggestion is adding a REST or Graphql endpoint requiring the cart id and mpId, to be able to set this id on the cart even if your backend and frontend are not on the same cookie domain.

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

1 participant