Redirect to a specific page after login using the new passwordless login

You do not need to set it up differently for mobile, the code should work
for both desktop and mobile.

On desktop its working perfectly fine but on mobile still redirect me to account page

Hi Armin, sorry I just checked, for mobile, the drawer menu will be used, you will need to edit the “snippets/header-drawer.liquid” file, with the same step. (change routes.account_url ), hope this helps! I also updated my blog post to include this step.

Will this method successfully redirect customers to their order page instead of the profile page when using passwordless login? I want to make sure they don’t land on the profile page. I’m not a developer, so I appreciate your explanation—it’ll help me pass this along to someone who can implement it. Thanks so much for your help!

Yes, to redirect to order page (instead of homepage from my original solution), you can replace the following code :

Login

with this code

Login

(notice the “/account/orders”).

Hope this helps.

Thank you thats work.

Hi Soulchild37,

I have a loyalty program on my Shopify store that has a popup login button. When users log in through this popup, they are always redirected to the order page instead of returning to the previous page they were on.

Do you know how I could modify the code so that logging in through the popup also redirects users to the previous page they visited?

Thanks in advance for your help!

Same problem here. Any advice on how to fix it?

Dude, you saved my day. I was actually going crazy with that redirect logic. Thanks a lot for sharing!