bigcommerce / storefront-data-hooks

Hooks for React Storefront UI Components
MIT License
166 stars 36 forks source link

Login not working again #90

Closed kogan007 closed 3 years ago

kogan007 commented 3 years ago

Hi it looks like the login cookie was made with the expectation that the header would return SHOP_TOKEN as well as shopper pref however I am only getting SHOP_TOKEN back from bigcommerce on login

jorgemasta commented 3 years ago

Hi @kogan007 , in theory with the SHOP_TOKEN is enough. What error do you have?

About of the expectation to receive SHOP_SESSION_TOKEN and Shopper-perf you're right, we're receiving null instead of the actual value. Screenshot 2021-09-13 at 17 35 56

We need to double check the getLoginCookie method. https://github.com/bigcommerce/storefront-data-hooks/blob/3fc059a0bd7b309ff662004611318ba10115b454/src/api/operations/login.ts#L59-L61

kogan007 commented 3 years ago

I'm not getting any errors but when a customer goes to checkout they are not logged in

jorgemasta commented 3 years ago

I'm not getting any errors but when a customer goes to checkout they are not logged in

Ok, thanks for the info! I will take a look ASAP.

jorgemasta commented 3 years ago

A workaround to avoid receiving null has been implemented and will be included in the next release.

However, it looks that the BC API has stopped sending SHOP_SESSION_TOKEN and Shopper-perf in the login mutation so we cannot set it in the client.

jorgemasta commented 3 years ago

Solved in 1.7.0. New changes related the login will be coming soon, check #101