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

Customer Account API integration not working when logging out from hosted pages #2368

Open
adamchipperfield opened this issue Jul 25, 2024 · 2 comments
Labels
Customer Account API Issues related to https://shopify.dev/docs/api/customer

Comments

@adamchipperfield
Copy link

adamchipperfield commented Jul 25, 2024

What is the location of your example repository?

No response

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2024.4.1

What version of Remix are you using?

No response

Steps to Reproduce

  1. Integrate the Customer Account API into Hydrogen (see guide)
  2. As a customer, log in
  3. Navigate to the Shopify hosted account pages (not in Hydrogen, so https://shopify.com/store-id/account) + click log out
  4. Navigate back to Hydrogen, notice that you are still in a logged in state

Expected Behavior

The Hydrogen state is logged out when the customer logs out of the hosted pages.

Actual Behavior

The customer is still logged in to Hydrogen despite logging out of hosted pages.

Note: I am making some assumptions here, such as the fact that hosted pages syncs that state to Hydrogen. If this isn't the case, shouldn't it be?

@frandiox
Copy link
Contributor

I believe it is not synced with Hydrogen due to performance reasons. Otherwise Hydrogen would need to add an extra HTTP call in every single request to double check the session is still valid, instead of letting it expire naturally.

cc @blittle @juanpprieto do you remember more about this issue?

@michenly
Copy link
Contributor

michenly commented Aug 9, 2024

This is expected behaviour.

When user logout under the checkout domain, hydrogen site does not know about the logout til the user trigger a behaviour that does a Customer Account API fetch and Hydrogen will then register a logout in the UI.

Security wise this is not an issue since if an user navigate back, they are only shown the data they already fetched while login. And action that trigger a new fetch (for new data) will then trigger a logout.

@romainshopify (from Customer Account API team), I believed this is already an UX improvement that's on your radar and being prioritize?

@michenly michenly added the Customer Account API Issues related to https://shopify.dev/docs/api/customer label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Account API Issues related to https://shopify.dev/docs/api/customer
Projects
None yet
Development

No branches or pull requests

3 participants