Grails Overrides Default Authentication

I found that grail validation also rejects some valid email addresses. I opened the github question here

Is there a way to override the default authentication in grails so that I can write my own validator for this purpose?

EDIT

I solved this problem by adding the latest apache commons validator in BuildConfig.groovy:

compile "commons-validator:commons-validator:1.4.1" 

But still, I will leave this question open as I still want to learn how to override the default grails default authentication function. I want this so that in the domain class where I used some kind of restriction like this:

 emailId(email:true,nullable:false) 

I should not change this email:true in the domain class. This needs to be redefined somewhere, so the email:true restriction uses my logic to verify the email id.

+4
source share
1 answer

Remove the email restriction and use matches . I leave the regex up to you :)

https://grails.imtqy.com/grails-doc/latest/ref/Constraints/matches.html

0
source

All Articles