Is there a way to redirect users when they log in to the previous page they were on before they landed on the log in page?
We are using the New customer accounts:
Is there a way to redirect users when they log in to the previous page they were on before they landed on the log in page?
We are using the New customer accounts:
Replace the value in the above line with the page you want to display after login.
There is no login.liquid or anything close to that.
This is not a theme thing.
The url when one clicks âaccountâ goes to â/accountâ and then redirects to this:
[https://customer.login.shopify.com/lookup?destination_uuid=1234&redirect_uri=https%3A%2F%2Fshopify.com%2F123%2Faccount%2Fcallback&rid=123&ui_locales=en-US](https://customer.login.shopify.com/lookup?destination_uuid=1234&redirect_uri=https%3A%2F%2Fshopify.com%2F123%2Faccount%2Fcallback&rid=123&ui_locales=en-US)
I am thinking I can try to hard-code the âaccountâ url in the Header and adding the parameter redirect_uri.
Just bumping this, I am also look for a solution where I can control the redirect on the New Account â Login screen.
We use YOTPO Loyalty and this New Account experience is extremely disruptive and confusing for customers since we canât include any of our Reward information or language on the New Account page.
Any solution for this please?
Iâm looking for this solution as well and cannot find the template mentioned in the theme either. Iâm trying to find the right form in main-login.liquid, but am not sure if Iâm looking at the right page and if the new vs. old account are even in the same place.
Did you end up finding a solution and if so, would you be willing to share it with this thread?
Thanks for any help!
I had confirmed by Shopify Support that redirecting back to the original page with NEW customer accounts is not supported. They duggested reverting back to classic.
Is it still the case?
Yes unfortunately I confirmed this a few days ago with support.
I reverted to using old accounts because of this - thatâs the only solution/workaround at the moment.
Yeah makes sense. Weâre using classic on our retail site, but our wholesale site uses Shopifyâs b2b features which unfortunately require new customer accounts. Kinda stuck in a bad spot here at the moment. Please help Shopify
Same boat here, need the b2b features but want to redirect to the front page after logging in.
Shopify please do somethingâŚ
I have created this solution for New Customer Accounts
Basically I am getting Last URL of non-login customers in browser session storage, and when they login with new Customer Account, after login the users initially redirected to Order Status Page, but from there when they click on Store the Home Page opens with accountnumber query Parameter,
![]()
so based on that I have created a following logic, and it redirect customers back to the paqe where they get to the login page
{% unless customer %}
{% endunless %}
,
Hey Shahidameen!
As far as I can understand, with your code the user is still directed to the account page after login, but then when going to the store he/she is redirected to the original page the came from before logging in - right?
My problem is I want the user to go straight to the front page of the store after login, so they donât ever see the account page unless they actively choose to go there. I donât think it is possible to add your script to the account page, which would be a way to solve this issue.
![]()
Try this and in retrun_to add your encoded return path
I am not sure what you mean, where should I create and use this URL?
you can replace the login URL with this (/customer_identity/login?return_to=) URL it will return the user after login to the given path
Where can you modify the login URL when using the new Customer Accounts?
With Recent Shopify Release, you can just do that, either redirect them to Previous Page where login was originated and even to the Custom Page.
Here is the Change Log
https://changelog.shopify.com/posts/direct-customers-back-to-the-online-store-after-login
Credits: @Taylor Page
Hello @frede-1994
Now with Shopify Recent Release, you can just do that (Can be redirected back to the Previous Page from where login was originated) or to any custom page using
storefront_login_url route in the routes object.
Here is Change Log.
https://changelog.shopify.com/posts/direct-customers-back-to-the-online-store-after-login