Hi all, I’m encountering a weird issue with error messages for custom-login. In short, it looks like what should be a username_exists
error is actually returning as something else, and thus prints the fallback
error message.
- I’m using a customized universal login page + Lock.
- I’ve enabled “Requires Username” in the database connection, so an additional username field is added to the login page automatically.
When a user tries to sign up with a username that’s already taken, it errors out as expected. But for some reason, the error message that prints on the page is the lock.fallback
, not the username_exists
message, like expected. Is this a bug?
I’ve already confirmed that it’s an issue with the username. When I use the exact same credentials and a different username, then signing up succeeds.
Here’s the snippet of code specific to lock:
// Available Lock configuration options: https://auth0.com/docs/libraries/lock/v11/configuration
var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
// Other config here
languageDictionary: {
title: '',
error: {
signUp: {
'lock.fallback': "There was an error signing up. Please try again",
"username_exists": "This username already exists",
}
},
signUpTitle: '',
usernameInputPlaceholder: 'Username',
passwordInputPlaceholder: 'Password',
usernameOrEmailInputPlaceholder: 'Email'
}
});
But here’s what actually shows when user tries to sign up with a username that’s already taken: