Use Pre-User Registration Action to Modify Error Message on Sign-up with Existing Email

Overview

Using api.access.deny as part of a pre-user registration action will not modify the generic “Something went wrong, please try again later” error message when the sign up occurs with a user that already exists in Auth0.

Applies To

  • Universal Login

Cause

The email validation error message is handled by api.validation.error instead.

Solution

Here is an example of what this pre-user registration action would look like:

exports.onExecutePreUserRegistration = async (event, api) => {
api.validation.error('email_conflict','Error')
};