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

Topic summary

The discussion addresses how to redirect customers to a specific page after login when using Shopify’s new passwordless login system.

Initial Problem:
PatrickHeck wanted to redirect users to a custom page after passwordless login, similar to using a GET parameter like ?redirect_to=/overview/.

Early Solutions & Limitations:

  • Initial suggestion involved modifying main-login.liquid with a hidden input field, but this only works for classic (password-based) login.
  • Shopify’s new passwordless login initially offered no customization options, forcing some users back to classic accounts.
  • Multiple users expressed frustration that the default behavior redirects to the orders page rather than the previous page or homepage.

Working Solution:
soulchild37 provided a functional approach using the URL format:

/customer_authentication/login?return_to={{ "/" | url_encode }}

This replaces the default /account/login link in theme files.

Implementation Details:

  • For desktop: Modify the login link in header sections
  • For mobile: Also update snippets/header-drawer.liquid
  • Can redirect to specific pages like /account/orders by changing the return_to parameter
  • A detailed tutorial was shared for official Shopify themes

Remaining Issue:
Users report that popup login buttons from third-party apps (like loyalty programs) still redirect to the order page instead of the previous page, with no solution yet provided.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

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!

2 Likes