The problem is that this validation does not run. I try to fill in the field with a string that is not an e-mail and I’m able to save the model.
The only validator that applies correctly is the len. I can’t make any other work.
Am I doing something wrong here?
This is the version I’m running: “forest-express-sequelize”: “^7.12.3”,
Looking at the latest sequelize documentationvalidate: { isEmail: true } should work. What version of sequelize are you using ? (The issue should be on there side)
In the meanwhile you can try to use the is validator with a regex from https://emailregex.com/.
validate: { is: /^(([^<>()\[\]\\.,;:\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,}))$/ }