How to redirect to specific page when user enters incorrect login details?

NielsSchutte
Explorer
167 2 8

Hi,

I'm trying to create a specific login modal on home page however when I enter wrong login details it gets redirected to default login page instead of staying on same page where modal is located.. How can I prevent this to happend? There is a way to redirect customers when they succesfull login with this line of code:

<input type="hidden" name="checkout_url" value="/collections/all">

Does anyone know the link or solution to stay on same page when entering wrong details? Test my page to see whats happening:

smartsnutrition.myshopify.com
Password: plazay


Click on the Account icon on the right top of my screen and login with some random details.

Hope someone can help

Thanks in advance

0 Likes

Hi,

 

Technical answer, can't really be done with an html input field.

Not without some sort of backend code to tell whether user has logged in correctly or incorrectly.

That backend code is where you would then do the redirect.

 

I'm not entire sure how it is set up so, I'd probably need to take a look in order to help.

 

Let me know if I can help further.

ui-gab
https://www.uiavenue.ca
We specialize in data analytics. If I've helped you today, please give our give our app a try (15-day free trial) https://apps.shopify.com/ui-ave-analytics and maybe write a good review.
Send me a message if you want a free data analysis consultation.
0 Likes
NielsSchutte
Explorer
167 2 8

Hi,

Oke thanks man!

0 Likes
Andrei21
New Member
6 0 0

Hi,

Did you guys ever figure this out?

I'm having this same issue. I have a custom LOG IN / SING UP pop up and the user is redirected away from it if they enter wrong password. 

How do we make the user stay on the pop up and not be redirected to shopify generic page?

Thanks

0 Likes
Chad_S_
Shopify Partner
5 1 1

I came up with a workaround of my own:  https://community.shopify.com/c/Technical-Q-A/Login-form-redirect-if-incorrect-password/m-p/977607/h... 

As long as you add a custom checkout_url field to your form, you can use the URL query to get back to your custom page AND display a 'password error' message there.  Check the link above; it's basically 2 steps to achieve it with a little javascript.

0 Likes