Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Email validation #679

Closed
41319 opened this issue Jan 3, 2019 · 3 comments
Closed

Email validation #679

41319 opened this issue Jan 3, 2019 · 3 comments
Labels
enhancement New feature or request
Projects

Comments

@41319
Copy link

41319 commented Jan 3, 2019

when using directus API, to create a user, I can send a invalid email in the body of the post. And this email will still be accepted.

Is there some form of validation in place? Or do I need to write it myself?

Thanks

@rijkvanzanten rijkvanzanten added the enhancement New feature or request label Jan 4, 2019
@rijkvanzanten
Copy link
Member

@wellingguzman Would adding a validation regex to the directus_fields column work in this instance?

@wellingguzman
Copy link
Contributor

Yes, adding a regex in directus_fields for the email field should fix this.

@cheehau as now you have to do it yourself.

I will fix this to support field validation by default on users email.

@wellingguzman wellingguzman added this to To do in v2.0.14 via automation Jan 4, 2019
@wellingguzman wellingguzman moved this from To do to In progress in v2.0.14 Jan 4, 2019
v2.0.14 automation moved this from In progress to Done Jan 4, 2019
@wellingguzman
Copy link
Contributor

I added a new custom validation named $email that you can use to validate email.

After the next release, directus_users.email will be validate by default. Current user will need to upgrade their database, or add $email to directus_users.email in directus_fields table.

@cheehau if you can't wait on the release, you can add a custom regex to validate the field.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
v2.0.14
  
Done
Development

No branches or pull requests

3 participants