-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lock not showing rule errors in redirect mode #637
Comments
Is the solution now to manually feed the error thrown by the lock, back into the lock, to fix inconsistent behaviour between modes? Any plans to properly fix that bug or remove automatic error handling completely? |
Yes, we added a way to let you show error messages in Lock. This way you can easily do the following
to show the error in lock, or you are free to handle on your app. |
@glena I would not consider your workaround a valid solution to the problem. Could this be fixed more thoroughly, please? |
@robert-weissgraeber It is not a workaround but the suggested approach to handle this case. Since the way people use Lock depends on each project and there are tons of different ways, we do not want to force a unflexible solution. What you want is that we force lock to be shown with the error message and we do not think it is a proper solution, that is why we allow you to handle the error as you want and if you prefer to show it inside lock, you can do it using the flashMessage. At the end, for us to handle it as you want, ends up abstracting this same behaviour inside lock and I can bet that it wont work for other customers and there will be a feature request to change it. This way, we avoid forcing that solution and provides flexibility to handle it as you prefer. |
Showing the error messages by default is already a feature, it's just not working in redirect mode. Errors not from rules are already shown the "unflexible" way. Additionally, even a flexible solution should provide usable defaults, especially for such user critical behaviour like displaying errors. The default "errors are just ignored" (which, if we'd follow the paradigm of flexibility, while staying consistent, would affect all errors) impacts the ability to simply drop in the auth0-lock with a handful lines of code and have it just work, without having to wire default behaviours together. If you do not want to force an unflexible solution, at least provide sensible defaults which work for the majority of use cases. |
I also don't see this is as a proper solution. Your are outsourcing the inconsistency of Locks behaviour to the developers using it. I do understand your concern regarding backwards compatibility and flexibility, though. Maybe a configuration flag, e.g. |
lock.show({
flashMessage:{
type: 'error',
text: error.error_description
}
});
});
@glena This won't work for me... i'm using redirect and "Hosted Pages"... any ideas?.. |
Could you please provide an example of using this feature with Hosted Pages? |
yes having the same problem with @eroncastro Could you please provide an example of using this feature with Hosted Pages? |
I don't think there is a solution for hosted pages |
Do we have an issue logged for hosted pages? |
the hosted login page will redirect back to your app with the error, right? Can't you catch the error there and handle it? |
@luisrudge I did this before by do workaround and put the error message inside the login page URL used to be looked like this
but now it changed, I noticed this about 2-3 days ago, now it only become
|
Anyone coming here for Lock,
The documentation has not been updated accordingly ; opened auth0/docs#6045 to fix it. |
@adrogon thanks for the PR! 🎉 |
Here is a solution for Hosted pages. Given the following rule:
Your call to Your app should already handle the Invoke
Even though the documentation states You may now catch that extra parameter in your Hosted Page to show a warning on the Lock dialog. Replace the default
|
Lock version: 10.4.0
Browser: Chromium 53 / Firefox 49
Throwing an
UnauthorizedError
in a rule does not display the error message in redirect mode.Works in popup mode.
Reproduction with the simple login example:
https://github.com/rashfael/auth0-javascript-spa/tree/master/01-Login
and this simple rule:
In redirect mode, the
authorization_error
event receives this object:In popup mode, the event receives another object:
Working popup mode:
No error in redirect mode:
The text was updated successfully, but these errors were encountered: