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

Hi everyone!

I’d like to use the new passwordless login experience, described here: https://help.shopify.com/de/manual/customers/customer-accounts/new-customer-accounts

After login in, though, I’d like to redirect customers to a page I specify. Does anyone know, it that’s possible?

I’m thinking of something like a GET parameter, that can be appended to the login URL.

e.g. https://shopify.com/XXXXXXXXXX/account ?redirect_to=/overview/

In this example, the “?redirect_to=/overview/” part would specify the target after login.

Any hints?

Best
Patrick

Hi @PatrickHeck

To change the landing url after login please follow the below steps.

Go to online-store - > edit theme search for main-login.liquid and find code

{%- form ‘customer_login’, novalidate: ‘novalidate’ -%}

now put the below line just after the above code

value=“/” refer to homepage here you can provide any URL.

Thanks @gr_trading ! But isn’t main-login.liquid meant to control the classical login? (The login that needs a password)

Hi @PatrickHeck

Yes, you are right because shopify don’t allow any kind of editing to login, and account flow.

Therefore if you need any design or flow change you have to switch to classic login.

Will the new login experience never have abilities for customization?

Meaning… if there is anything in it that’s not working for a certain store solution, is the only option to go back to classic?

I’ve just made the switch myself and am not fully understanding if there are any customization options at all.

Since you started this a few month ago, Patrick, I wonder if you can help me understand this.

Hi Linia,

thanks for contributing to this thread. However, I don’t have any further information than the accepted solution contains. For general customization options, apart from the one discussed here, take a look at the manual: https://help.shopify.com/de/manual/customers/customer-accounts/new-customer-accounts.

Thanks so much for the response. Yes - I had run into that documentation while switching myself.

The documentation is helpful. I just didn’t realize that the flow would be and going to the ‘orders’ page after login, which is quite unintuitive/problematic for my business, given the experience we need to provide clients.

The fact that there can be no customization is a bit surprising.

In any case - may end up going back to classic accounts. Thanks again for your response!

Hi @linia ,

To customise the order section Shopify is working for order checkout extension permissions.

its in developer mode and allowed to build and test the apps.

Shopify is trying to stop users to polluting its theme structure by stoping the access to their key resources and making more scoping to do things using APPs only.

That’s sad that this will only be through apps :confused:

I can see their perspective, but if you’re not a developer and don’t want to spend money on apps for every tiny thing you want to do, this makes the new experience quite unusable.

But thank you for the information - at least now I know this means I have to go back to the old version. The default behavior doesn’t work for my business.

Thanks for taking the time to share the overall direction they’re going in!

This is one of the dumbest things I’ve ever seen. I finally made the switch last night to the New Customer accounts. Just tested this morning, and it’s taking me to an account page? No other website I’ve ever used does that. It takes you right back to the page you were on when you logged in. So. Dumb.

Agree. I had to switch to classic account for this functionality earlier in the year. Am revisiting this now as I really would like the frictionless login experience of ‘new accounts’, but also need the frictionless redirecting ability of classic accounts. Assuming from this comment in Sep that the situation still hasn’t changed.

It is now possible to redirect to specific page after login on the new passswordless login, it is similar to the login URL you first mentioned.

You can use this link format (replace the default “/account/login” in your theme ) :

Login

https://shopify.dev/docs/storefronts/themes/login#direct-customers-back-to-another-page-on-the-online-store

This is working properly. thank you very much.

Will this work if I want to redirect from the profile page to the order page, all within the new customer accounts feature?

Hi @kgoslat ,

Yes, its working. We implement this to our store to enable force login to see the code and once they are logged in. It’s redirecting user to its blog post.

See it in action here
https://letsdebugcode.grtrading.in/blogs/news/how-to-add-a-custom-donation-product-in-shopify

Here’s the most concise approach to do this:
just below this line “{%- form ‘customer_login’, novalidate: ‘novalidate’ -%}” in the login section , paste this line: “”. You can replace “/collections” with the page you wanna redirect your user to after a successful login.

Hi, I followed your suggestion to replace /account/login with /customer_authentication/login?return_to={{ “/” | url_encode }}, but it’s not redirecting to the homepage after login.

Could you please provide a step-by-step guide on exactly where to place this link in my Shopify theme?

  • Which file(s) should I modify?
  • Where exactly in the code should I replace the login link?
  • Do I need to change any Shopify settings for this to work?

I appreciate your help!

Hi Armin,

Which file did you modify to change the " /account/login" with “/customer_authentication/login?return_to={{ “/” | url_encode }}” ?

This is specific to the new customer accounts (Shopify Settings > Customer accounts > Customer accounts).

I have written a step by step tutorial here : https://yagisoftware.com/articles/how-to-redirect-new-customer-account-login-to-different-page

The tutorial covers official Shopify themes.

Hope this can help.

Thank you so much! Your tutorial was an absolute lifesaver, and it worked perfectly! I was able to set up the redirect successfully. I really appreciate your help—you’re a legend!

It works on the desktop version. Do I need to set it up differently on mobile?