How to Show a Specific Auth0 Error Message When a User Signs Up with an Existing Email
By default, Auth0 may display a generic error message when attempting to sign up for an already registered email address.
We're sorry, something went wrong when attempting to sign up.
This is a security feature to prevent user enumeration. This article will provide steps to show a more user-friendly message to improve the user experience.
- Universal Login
- Authentication API
When the Use a generic response in public signup API error message setting is enabled, Auth0 returns a non-specific error message, for example, We're sorry, something went wrong when attempting to sign up.) to prevent attackers from determining whether a user exists.
To display a more descriptive error message when a user tries to sign up with an already registered email:
- Log in to the Auth0 Dashboard.
- Navigate to Settings > Advanced.
- Locate the setting Use a generic response in public signup API error message.
- Disable this setting.
- Save the changes.
Once disabled, users will receive clearer messages (for example, "The user already exists.") during signup attempts.
This setting affects the response body when calling the POST /dbconnections/signup endpoint of the Authentication API.
When the setting is ON:
{
"name": "BadRequestError",
"code": "invalid_signup",
"description": "Invalid sign up",
"statusCode": 400,
"data": {
"identifierType": "email"
}
}
When the setting is OFF:
{
"name": "BadRequestError",
"code": "user_exists",
"description": "The user already exists.",
"statusCode": 400,
"data": {
"identifierType": "email"
}
}
NOTE: Disabling this setting increases the risk of user enumeration, since attackers can programmatically detect whether an email is associated with an account. For more details, refer to the official Auth0 Documentation: Auth0 Tenant Settings - Generic Response Setting.