How to change the Error Messages in Signup page?

When trying to register a new user on the registration page, an error message saying “Something went wrong, please try again later” appears if a user with the same email address already exists.
I’d like to change this to a custom message.

I’ve tried two ways, but neither worked well.

  1. Using Pre-User-Registration Action (reference)


  2. Using languageDictionary (reference)

I would be grateful if someone could kindly help me.

You should be able to define error message in the second param of the api.validation.error function.

exports.onExecutePreUserRegistration = async (event, api) => {
  const firstName = event.request.body['ulp-first-name'];
  if(!firstName) {
    api.validation.error("invalid_payload", "Missing first name");
    return;
  }

  api.user.setUserMetadata("firstName", firstName);
};

Result:

Reference: Use Actions to Validate and Store End-user Data Gathered By Signup Prompt Customizations

Thank you, @kostetskyroma!
I’ve set it up according to your advice, but unfortunately, it still doesn’t work.

I’ve checked the reference you shared, and it mentions that a custom domain is one of the prerequisites.

I’m using Auth0 in Free Plan, so I can’t use the custom domain.

Does it mean that I must have a paid Auth0 subscription to change the error message of Signup page?