Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Redirect on logging out customer account Shopify is not working

Solved

Redirect on logging out customer account Shopify is not working

waisal
Shopify Partner
5 1 3

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

Accepted Solution (1)
waisal
Shopify Partner
5 1 3

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!.

View solution in original post

Replies 5 (5)

David-9
New Member
5 0 0

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!

waisal
Shopify Partner
5 1 3

I am using headless, and I have added the Logout URI but it's not working. Is there any step I might have missed?

ryan2023_0-1713279228714.png

 

jannis31
Visitor
1 0 1

I am facing the same issue. Any updates?

waisal
Shopify Partner
5 1 3

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!.

jamalsoueidan
Shopify Partner
66 3 10

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.