Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
I am developing an application using the headless customer account API, but when I try to log out from the application, the logout endpoint always redirects to the www.shopify.com page.
Below is an example of the generated endpoint https://shopify.com/xxxx/auth/logout?id_token_hint=atkn_CqwCCLTcubAGENSUurAGYp0CCAYSEGD7fldKFUp5l7w0...
Any help would be greatly appreciated.
Regards,
Waisal Riyan
Solved! Go to the solution
This is an accepted solution.
It seems that I mistakenly entered the token in the id_token_hint. After I tried using this token, it worked!.
Have you tried changing the logout URI in your storefront settings? I am using Hydrogen, so I can access this setting like so:
Hydrogen sales channel > storefront settings > customer account API > scroll down to "Application Setup".
Here you can add the URL(s) you wish to redirect to after logout. This is assuming that your application is connected to your Shopify admin account.
Hope this helps!
I am using headless, and I have added the Logout URI but it's not working. Is there any step I might have missed?
I am facing the same issue. Any updates?
This is an accepted solution.
It seems that I mistakenly entered the token in the id_token_hint. After I tried using this token, it worked!.
did you setup custom domain?
did you redirect your theme domain to hydrogen?
You can override the logout yourself, and delete the session or cookies and redirect back to your own page.