# Customization of error codes for login flow

**URL:** <https://community.auth0.com/t/customization-of-error-codes-for-login-flow/56304>\
**Category:** Get Help\
**Created:** [January 16, 2021, 2:48pm UTC](https://community.auth0.com/t/customization-of-error-codes-for-login-flow/56304 "2021-01-16T14:48:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pastdevr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pastdevr/32/25199_2.png) [@pastdevr](https://community.auth0.com/u/pastdevr)\
**Post date:** [January 16, 2021, 2:48pm UTC](https://community.auth0.com/t/customization-of-error-codes-for-login-flow/56304/1 "2021-01-16T14:48:14Z")

</div>

Hi,  
the use case I need to implement requires the way to distinguish between login with a correct email and wrong password and login with both credentials wrong (email/password). I need to provide different error messages for login flows. As far as I know, currently, Auth0 returns single error code for both cases _invalid\_user\_password_ which can be customized for example when using Auth0 Lock widget.

Is it possible to differentiate the cases I mentioned to have better customization of error messages?  
The login action happens on the Universal Login page.

---

<div class="post-metadata">

**Author:** ![sidharth.chaudhary](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sidharth.chaudhary/32/20686_2.png) [@sidharth.chaudhary](https://community.auth0.com/u/sidharth.chaudhary)\
**Post date:** [January 17, 2021, 10:37pm UTC](https://community.auth0.com/t/customization-of-error-codes-for-login-flow/56304/2 "2021-01-17T22:37:59Z")

</div>

> [@pastdevr](#):
>
> distinguish between login with a correct email and wrong password and login with both credentials wrong (email/password)

Hey @pastdevr, Welcome to the Auth0 Community.

Yes, we only support customization of _invalid\_user\_password_, which covers both scenarios:

> **[Customize Lock Error Messages](https://auth0.com/docs/customize/customize-lock-error-messages)**
>
> Customizing error messages with Lock

To distinguish between login with a correct email and wrong password and login with both credentials wrong (email/password) poses risks of revealing the existing email in the database in my opinion. Hence the generic error.

Regards,  
Sid

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 28, 2021, 3:56pm UTC](https://community.auth0.com/t/customization-of-error-codes-for-login-flow/56304/3 "2021-01-28T15:56:04Z")

</div>


