commerce icon indicating copy to clipboard operation
commerce copied to clipboard

Login does not persist to checkout

Open avisra opened this issue 3 years ago • 3 comments

You can reproduce this on the Vercel demo store by signing up for an account, adding products to your cart, and then clicking through to checkout. Upon landing on the checkout page, it thinks I am a guest - instead of recognizing my user.

avisra avatar Feb 24 '21 05:02 avisra

Hey all,

I actually managed to solve this myself. I'm not sure why Vercel hasn't done a similar thing with their demo store. And ideally, this workaround wouldn't be necessary (I would rather be able to authenticate the checkout without sharing cookies).

Instead of using the default BigCommerce store URL, I setup a url like checkout.mywebsite.com. And my headless shop is www.mywebsite.com. In my code which creates the SHOP_TOKEN cookie, I updated the cookie to be a TLD cookie (e.g. forced it to create the cookie for mywebsite.com). After doing this, the checkout process was aware of the signed in user.

Thanks,

Chris

avisra avatar Mar 04 '21 05:03 avisra

Hi @avisra, I am also facing the same issue on the Vercel demo. Could you please provide code snippet on your implementation.

Also since you stated that you are using checkout.mywebsite.com instead of the Bigcommerce store checkout url, does this mean you are using embedded checkout?

Thanks

srahman99 avatar Jun 16 '21 22:06 srahman99

I think this issue might be linked https://github.com/vercel/commerce/issues/531

Florian-crg avatar Oct 25 '21 11:10 Florian-crg

Hey there! Thank you for your contribution. We have decided to take Next.js Commerce in a new direction and will be closing out current PRs and issues due to this change. Please see this PR for more details: #966

manovotny avatar Apr 18 '23 02:04 manovotny