# Error message bug in custom-login

**URL:** <https://community.auth0.com/t/error-message-bug-in-custom-login/60743>\
**Category:** Get Help\
**Tags:** error, signup, custom-login, login, universal-login\
**Created:** [April 8, 2021, 12:12am UTC](https://community.auth0.com/t/error-message-bug-in-custom-login/60743 "2021-04-08T00:12:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvxt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mvxt/32/12906_2.png) [@mvxt](https://community.auth0.com/u/mvxt)\
**Post date:** [April 8, 2021, 12:12am UTC](https://community.auth0.com/t/error-message-bug-in-custom-login/60743/1 "2021-04-08T00:12:49Z")

</div>

Hi all, I’m encountering a weird issue with error messages for custom-login. In short, it looks like what should be a `username_exists` error is actually returning as something else, and thus prints the `fallback` error message.

- I’m using a customized universal login page + Lock.
- I’ve enabled “Requires Username” in the database connection, so an additional username field is added to the login page automatically.

When a user tries to sign up with a username that’s already taken, it errors out as expected. But for some reason, the error message that prints on the page is the `lock.fallback`, not the `username_exists` message, like expected. Is this a bug?

I’ve already confirmed that it’s an issue with the username. When I use the exact same credentials and a different username, then signing up succeeds.

Here’s the snippet of code specific to lock:

```auto
    // Available Lock configuration options: https://auth0.com/docs/libraries/lock/v11/configuration
    var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
      // Other config here
      languageDictionary: {
        title: '',
        error: {
          signUp: {
            'lock.fallback': "There was an error signing up. Please try again",
            "username_exists": "This username already exists",
          }
        },
        signUpTitle: '',
        usernameInputPlaceholder: 'Username',
        passwordInputPlaceholder: 'Password',
        usernameOrEmailInputPlaceholder: 'Email'
      }
    });

```

But here’s what actually shows when user tries to sign up with a username that’s already taken:

![image](https://global.discourse-cdn.com/auth0/original/3X/e/5/e584c4964b3bebd56a5e75496e771c1b7b397301.png)

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 8, 2021, 6:05pm UTC](https://community.auth0.com/t/error-message-bug-in-custom-login/60743/3 "2021-04-08T18:05:59Z")

</div>

Hi @mvxt,

In your advanced settings, you can disable the “Use a generic response in public signup API error message” so that the `username_exists` is returned. Otherwise a generic error will be returned for security reasons.

 ![screenshot-manage.auth0.com-2021.04.08-14_03_05](https://global.discourse-cdn.com/auth0/original/3X/4/e/4e52b2bdb9ae20cab80716737415da726398a351.png)

> [@How can I avoid the generic error message when a user attempts to sign up with an existing email address?](https://community.auth0.com/t/how-can-i-avoid-the-generic-error-message-when-a-user-attempts-to-sign-up-with-an-existing-email-address/43199):
>
> When a user attempts to sign up with an existing email address, they see this generic error: WE’RE SORRY, SOMETHING WENT WRONG WHEN ATTEMPTING TO SIGN UP. This is confusing. How can I show them ‘user already exists’ instead?

---

<div class="post-metadata">

**Author:** ![mvxt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mvxt/32/12906_2.png) [@mvxt](https://community.auth0.com/u/mvxt)\
**Post date:** [April 9, 2021, 5:51am UTC](https://community.auth0.com/t/error-message-bug-in-custom-login/60743/4 "2021-04-09T05:51:23Z")

</div>

It seems odd that this advanced setting is in the User’s Settings, not that settings for a specific application. This is why I wouldn’t have known or found this setting.

For example, what if a user wants to return generic responses for one of their applications but not another?

Either way, thank you! This fixes my issue for now.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 9, 2021, 11:14am UTC](https://community.auth0.com/t/error-message-bug-in-custom-login/60743/5 "2021-04-09T11:14:39Z")

</div>

Glad to hear that solves your issue! Yes, this functionality is set at the tenant level. If you have a use case that would require different settings for different apps, it’d be great to get your feedback:

> **[Feedback](https://community.auth0.com/c/feedback/95)**
>
> Submit and vote on product feedback and feature requests.

---

<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:** [April 24, 2021, 11:14am UTC](https://community.auth0.com/t/error-message-bug-in-custom-login/60743/6 "2021-04-24T11:14:42Z")

</div>

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