Overview
When updating a user’s email address, the following error may occur if the email address is considered not valid:
Payload validation error: ‘Object didn’t pass validation for format email: test@test-au-.com’ on property email (The user’s email).
This article explains how Auth0 validates email addresses.
Applies To
*Email Validation
Solution
Auth0 uses the isEmail
function provided by the validator npm package. The full code of the function can be found in this Github Repository. Auth0 does not provide any options parameters to the function, so it uses the defaults defined in this variable.
If the email address contains characters such as ‘-’, validation will fail.
There is currently no way to customize the validation logic. Please feel free to submit a feature request using the Product Feedback form. More information about this process can be found at How do I submit Product feedback or feature requests?