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

postLogoutRedirectUri on customerAccount.logout() is not working #2684

Closed
ybikov opened this issue Dec 20, 2024 · 1 comment
Closed

postLogoutRedirectUri on customerAccount.logout() is not working #2684

ybikov opened this issue Dec 20, 2024 · 1 comment

Comments

@ybikov
Copy link

ybikov commented Dec 20, 2024

What is the location of your example repository?

Private

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2024.7.3

What version of Remix are you using?

2.0.6

Steps to Reproduce

In account_.logout.jsx update the action with the following:

export async function action({context}) {
  return context.customerAccount.logout({
    postLogoutRedirectUri: '/collections'
  });
}

Expected Behavior

To be redirected to "/collections" after the user is signed out.

Actual Behavior

It ignores the postLogoutRedirectUri and redirects to Logout URI that is set in Shopify Customer Account API settings.

@wizardlyhel
Copy link
Contributor

postLogoutRedirectUri won't work if you didn't register your logout url in the admin. In your Hydrogen storefront setting, under the customer account api configuration, it should have a default logout url. Add the extra logout url you wish to have it working as well.

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

2 participants