Redirecting on login failure

Is there a way to handle the login failure scenario in Auth0?

I want to redirect the user to another url if the login attempt is failed.

Hey there Ramesh!

Can you share more around the code stack you use?

Here are the general links that can be helpful:

Hi Konrad

I am trying to implement Auth0 in my opencart website. I am using Auth0-PHP library.

Existing opencart login is overriden with below code

$auth0 = new Auth0\SDK\Auth0([
‘domain’ => ‘londinium.eu.auth0.com’,
‘client_id’ => $this->config->get(‘module_auth0_client_id’),
‘client_secret’ => $this->config->get(‘module_auth0_client_secret’),
‘redirect_uri’ => $this->config->get(‘module_auth0_redirect_url’),
‘scope’ => ‘openid profile email’,
]);
$auth0->login();

The login is working fine. In case of login failure, it shows “Wrong email or password” in the Auth0 login dialogue itself. Instead of showing this message, I want to redirect the user to our custom page if login fails

Unfortunately I don’t have any experience with PHP but have you tried following the docs I linked above?

Yes, those links are only about redirecting users after successful login. My question is not specific to using via PHP. Generally talking, does Auith0 provide any feature or web hooks to handle invalid login attempts

Utilising second doc I mentioned above you can utilise a rule and modify its code to redirect the user to a certain url after unssuccessful login event.

Also this:

but only if you use Universal Login

Let me know if you get something working out of that!

Sure Konard, I am checking this. I will update you

1 Like

Perfect! Thanks for letting me know!

Hey there Ramesh have you had a chance to test anything in the meantime?

I tried creating a custom error page as you suggested but the login errors are not redirecting to this page. Don’t know why. Here is the screenshot