Have your say in Community Polls: What was/is your greatest motivation to start your own business?

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

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

NielsSchutte
Explorer
168 2 12

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

Replies 5 (5)

ui-gab
Shopify Partner
211 13 55

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.
NielsSchutte
Explorer
168 2 12

Hi,

Oke thanks man!

Andrei21
Excursionist
18 0 2

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

Chad_S_
Shopify Partner
7 1 3

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.

josu24
Shopify Partner
11 0 0

I'm having the same problem still, any suggestions?