Checking for an existing user

hi there! is there any way we can check from the frontend if an inputted email already belongs to an existing user? i.e. if the email already exists, show a message

1 Like

Hi @juliachxng,

Welcome to the Auth0 Community!

To check if a user already exists, the Management Api can be called using the Search Users by Email - GET /v2/users-by-email. However, the recommended best practice is to call the Management Api from the backend, since doing this from the frontend will expose the Management Api Access Token.

In order to generate a more specific message to the user when they sign up using an already existing email you can disable the β€œUse a generic response in public signup API error message” setting from the Auth0 Dashboard - Tenant Settings - Advanced.

  • If enabled, this will return a non-specific error message in the public signup API which will prevent users from being able to find out if an e-mail address or username has previously registered to prevent enumeration attacks, such as β€œWe’re sorry, something went wrong when attempting to sign up.”

  • If disabled, users will receive clearer messages (e.g., β€œThe user already exists.”) during signup attempts.

You can check out this article How to Show a Specific Error Message When a User Signs Up with an Existing Email for more details.

Best regards,
Remus

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