-
Notifications
You must be signed in to change notification settings - Fork 554
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
Add feature to display custom error messages from rules #86
Comments
👍 +1 |
I tried doing the same to check email verification before allowing signin into the application.
I get "server error" error which is too generic and the message I set in rules doesn't seem to be displayed. |
I created this question on the same topic https://ask.auth0.com/t/force-email-verification-error-message/1145 It's been a while since this was first raised. Is this something that Auth0 plan to implement? Without it - it seems to negate the the use of rules as a way of introducing additional authentication logic. Thanks Jim |
Yes, this is coming soon. Authentication logic from rules is still usable because custom errors can be parsed by your application (not yet by Lock). Stay tuned! |
@jculverwell @dhiva This was implemented in the latest auth0/[email protected] |
Hi we could use this as well. We are currently using a custom rule to block blacklisted domains (see below), however we want the lock widget to display our error message instead of redirecting the user to an error page (this behavior is causing attrition on our site). Rule Code: function (user, context, callback) {
var blacklist = ['gmail.com', 'example.org']; //authorized domains
var userMayBeDenied = blacklist.some(
function (domain) {
var emailSplit = user.email.split('@');
return emailSplit[emailSplit.length - 1].toLowerCase() === domain;
});
if (userMayBeDenied) {
return callback(new UnauthorizedError('Personal email addresses are not allowed. Please use your company email to register.'));
}
return callback(null, user, context);
} Cheers, |
@bryanvaz Hi! could you please provide more details so we can track this down
I've tried with several connection and I was not able to replicate the issue. |
Add missing hash to an href attribute
Default DB connection fix
This is closed but how did it get solved? How can we show custom rule error messages in the lock for web? |
@jmarbutt whenever you return something like return callback(new UnauthorizedError('Your custom error message.')); from a rule context. it will be displayed in Lock. |
@cristiandouce Is that true in redirect mode as well? |
@yogipatel no. I asume you mean this issue then: /issues/637 |
To reproduce, create a rule with the following content:
Custom error message is being returned but not shown:
Also, the error message being displayed is "Wrong email or password", which is incorrect.
The text was updated successfully, but these errors were encountered: