Open ZhenyiZhang opened 11 months ago
Hey @ZhenyiZhang, according to the attached screenshot, the customer is not logged in to new customer accounts ( if a customer has already logged in, there will be a profile section )
can you help to provide more details about this step
3. log in as a customer using the email during the checkout (eg. log in on the checkout information page)
?
If the merchant is using new customer accounts, logging in during checkout should mean going through the passwordless (use 6 digital code) login page, and being navigating back to the checkout page. Otherwise, the customer is not logged in to new customer accounts.
@brianshen1990 sorry for the late reply. I recorded a video to show the step of 3. log in as a customer using the email during the checkout (eg. log in on the checkout information page)
, and hopefully this can demonstrate the case better. Let me know if you need further explanations!
Hey @ZhenyiZhang , thanks for the video and I can reproduced it now, and will get back to you soon!
Hey @ZhenyiZhang , logging in during checkout means the customer is logged in to to both storefront and checkout, but not new customer accounts. When navigating from thankyou page to order status page, it is still regarded as not logged in. At this time, if we click orders or profile link from navigation menu, a redirection will happen and new customer accounts will be able to get the logged in state. But order status page is a little different, it doesn't need authentication, no redirection will happen, so when redirecting from thankyou page to order details page, the customer is regarded as not logged in.
We are trying to come up with a solution, and will get you updated!
Thank you so much @brianshen1990!
When logging in to the new customer accounts, should the Storefront also see a user's signed in state?
I believe I'm also seeing this bug.
The useEmail()
hook works, as well as the useOrder()
hook, but the useCustomer()
hook doesn't return any data:
Link to repro: https://github.com/Shopify/ui-extensions/issues/1904#issuecomment-2117739158
@romainshopify can we add this to our Lift and shift m1 backlog?
Please list the package(s) involved in the issue, and include the version you are using
Describe the bug
We discovered an issue of logged customer state is not carried to the order status page.
Steps to replicate:
the customer logged-in state would be lost even through the customer has logged in from the earlier step.
This issue has been causing us not being able to get the customer data using
useCustomer
hook when developing order status page checkout extension.As long as the customer exits the checkout flow and goes to the storefront pages, the logged-in state will be shown correctly and also available on OSP if we place a new order and land on order status page again.
Expected behaviour
The customer logged-in state should be shown correctly on order status page and the logged-in customer data should be available.
Screenshots
The screenshot below was taken on the order status page and the customer has logged in earlier on the information page.
Additional context
This issue is similar to a previous report https://github.com/Shopify/ui-extensions/issues/1587 but we're not sure if this has the same root cause.