Auth0 Home Blog Docs

Customize error message

I am trying to show the error at create custom script for custom database as:

   auth0_dialog.show({languageDictionary: {
      error: {
       ValidationError: {
         'already_exist': ' My custom already exist error'
       }
      }
    });

and in the create script:

return callback(new ValidationError('already_exist', res.reason));

However, I just get the error:

We're sorry, something went wrong when attempting to sign up.

here is my response from custom create:

{"name":"ValidationError","message":"already exist","code":"already_exist","description":"already exist","fromSandbox":true,"statusCode":400}

Unfortunately, I could not find any details at docs here: https://auth0.com/docs/libraries/lock/v11/customizing-error-messages , How would I know the correct key to use for my case?

Kindly advice

2 Likes

Hey @hopewise,

Looks like you might be looking for something along these lines (according to i18n/en.js):

error: {
   signUp: { 
      user_exists: 'The user already exists.',
    }
}

Cheers!

1 Like

Thank you @art.rosnovsky

1 Like

Glad you got it working now @hopewise!

2 Likes

Thanks for great community :+1:

2 Likes

Thanks a lot for those kind words!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.