Auth0 Home Blog Docs

Email validation rules, please make them public knowledge

During signup, the lock form does some email validation:

image%20(13)

Other parts of our system also validate emails and we want to provide a consistent experience across our whole app regarding email rules.

What are the exact rules Auth0 uses for this field? Or the regex used?

Hey there @jesse2!

Not sure about that but let me do the research and get back to you soon!

Thanks @konrad.sopala
Did you find anything yet?

Hey there @jesse2!

I was told by our engineering team that we do have no doc on the rules we use in Lock for validating those fields. The only source of knowledge for that is to inspect Lock source code.

Thanks for the suggestion. I believe I’ve found it here:

const regExp = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
1 Like

Thanks a lot for sharing that with the rest of community!