# Custom database: signup returns vague error when user already exists

**URL:** <https://community.auth0.com/t/custom-database-signup-returns-vague-error-when-user-already-exists/72970>\
**Category:** Get Help\
**Tags:** custom-database\
**Created:** [November 11, 2021, 9:33am UTC](https://community.auth0.com/t/custom-database-signup-returns-vague-error-when-user-already-exists/72970 "2021-11-11T09:33:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinmaillard](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/martinmaillard/32/12776_2.png) [@martinmaillard](https://community.auth0.com/u/martinmaillard)\
**Post date:** [November 11, 2021, 9:33am UTC](https://community.auth0.com/t/custom-database-signup-returns-vague-error-when-user-already-exists/72970/1 "2021-11-11T09:33:26Z")

</div>

I’m using a “custom database” connection and have implemented all the action scripts. Everything works fine, except for one thing. If a user tries to sign up, but already exists in my external system, they will get a vague error like “an error occurred during signup”. This is very confusing and I want them to know that they already have an account.

I know that the signup process first calls the `getUser` script to check if the user exists. My `getUser` properly finds the user and returns a user profile. The `create` script doesn’t even get called, so I can’t return the proper `new ValidationError("user_exists", "...")` exception. I know really know what I can do.

Can anyone help me?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [November 11, 2021, 6:59pm UTC](https://community.auth0.com/t/custom-database-signup-returns-vague-error-when-user-already-exists/72970/3 "2021-11-11T18:59:09Z")

</div>

Hi @martinmaillard,

Welcome to the Auth0 Community!

I understand that your users are seeing a vague error whenever they attempt to sign up but already exist in your Custom Database and would like to inform your users that they already have an account.

Before we continue, I’d like to emphasize that the error message is purposefully designed to be vague to not give away any clues that the email address or user already exists. Having an error message that reveals information about the email address or user’s existence would expose the application to user enumeration. More on that detailed in [this](https://community.auth0.com/t/custom-sign-up-error-message-for-user-that-already-exists/39719/2) Community Post.

Now, you can change the sign-up error message and it’s up to your discretion, but I’d recommend being as conservative as possible with the custom error message to avoid any security risks.

To customize the sign-up error message, you’ll need to go to your Universal Login Page and modify the [Language Dictionary Object](https://github.com/auth0/lock/blob/master/src/i18n/en.js) in the [Lock Configuration Options](https://auth0.com/docs/libraries/lock/lock-configuration).

Something like the following:

```auto
var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
    languageDictionary: {
        error:{
            signUp: {
            'lock.fallback': "We're sorry, something went wrong when attempting to sign up.",
            }
        }
    },
    ... 
    // Redacted for brevity

```

Hoped this helps!

Please let me know if there are any further questions. I’d be happy to help.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 26, 2021, 6:59pm UTC](https://community.auth0.com/t/custom-database-signup-returns-vague-error-when-user-already-exists/72970/4 "2021-11-26T18:59:49Z")

</div>

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