How to customize the error message when siup up an email which already exists?

Hi,
I am trying to customize the error message.
The use case is “sign up an email which already exists”.

I can get the message “The user already exists.” in the monitoring logs in Dashboard.

And also I get the message “Something went wrong, please try again later.” in the runtime UI.

Currently, I cannot find a way to customize the error message (“Something went wrong, please try again later.”) with either Rules, Hooks, or Actions.
Could you help show me how to do it.
Thanks.

Hi @nicky.tseng ,

Welcome to the Auth0 Community!

We can customize the error message in the signup page with the Auth0 Management API endpoint

PUT https://{your domain}/api/v2/prompts/signup/custom-text/en

{
    "signup":{
        "auth0-users-validation":"your customized error message"
    }
}

This is how it looks after sending the request.

Reference:
https://auth0.com/docs/customize/universal-login-pages/customize-login-text-prompts

Hope this helps!

2 Likes

Hi @lihua.zhang ,

Thanks a lot, it works now.
Now I have one more question:

Why not the error message shows signup.“email-in-use” instead of signup.“auth0-users-validation” since the monitoring log has indicated “The user already exists”?



Thanks.

Hi @nicky.tseng ,

The text of the message determines which key to use when customizing the text prompt. As shown below, for “Something went wrong, please try again later”, there are two keys. Since this is due to user validation, we use the key auth0-users-validation.


Does that answer your question?

Hi @lihua.zhang ,

Thanks for your quick response and help!

What I mean is the actual use case meets the key email-in-use (The user already exists.).
I think Auth0 should return email-in-use in this case, not auth0-users-validation.

If Auth0 returns the key email-in-use (The user already exists.), then I don’t need to customize the message of auth0-users-validation.

Note:
The use case: sign up an email which already signed up before.
The Dashboard > Monitoring Log indicates Auto0 can catch the actual error: The user already exists..

Thanks.

Hi @nicky.tseng ,

I understand your concerns. Please feel free to communicate this directly to our product team using our feedback page. Thank you!

1 Like

Thanks @lihua.zhang .

auth0-users-validation seems to be pretty broad. Is it possible that another validation error happens that is not related to username taken? If so, then whatever custom message we assign for that key will be wrong in some cases.

Looks like there’s already already a username-taken key. Why not return that key instead in the case trying to sign up with a user name that is already taken? In fact, looks like there is already an appropriate default error message associated with it, “The username provided is in use already.” Why wasn’t this used? That seems to be the way it should work by default.

auth0-username-taken

@lihua.zhang @nicky.tseng

I found the answer. There actually is a toggle to display the user already exists message:

It does exactly what I’m looking for:

user-already-exists

This is with the new universal login page btw. Didn’t have to modify the template. It just worked. :slight_smile:

3 Likes