Java – Grails overrides default email authentication
I found that Grails authentication also rejected some valid email addresses I opened a question on GitHub here
Is there a way to override the default email validation in Grails so that I can write my own validator for this purpose?
edit
I passed in buildconfig Adding the latest version of Apache commons validator in groovy solves this problem:
compile "commons-validator:commons-validator:1.4.1"
But I'll still open this question because I still want to know how to override the default Grails email validator I want it to some extent so that in domain classes where I use such constraints:
emailId(email:true,nullable:false)
I should not change this email: true in the domain class This should be overridden somewhere so that the email: true constraint uses my logic to validate the email ID
Solution
Delete email constraint and use match instead I leave regular expressions to you:)
https://grails.github.io/grails-doc/latest/ref/Constraints/matches.html