Normalize email sanitizing only gmail dots


Hi there :slight_smile:

Is it possible to use sanitization rule for email and only remove dots when email is gmail domain?

For example:

email: ‘normalize_email’ will always remove dots, so emails like john.doe@notgmailcom will not be correct at all
while with rule email: ‘normalize_email:!rd’ this will work but it will allow users to have multiple accounts with same email if they use gmail. Because john.doe@gmailcom is infact the same as johndoe@gmailcom and even j.o.h.n.d.o.e@gmailcom

This lib has additional config options that can handle this. Is this possible in adonis without extending validator?

btw. couldnt create topic because new users cant add more then 2 links inside topic… email were recognized as links so they are without .com



If anyone had issues with this… Since @adonisjs/validator 5.0.0 this is solved!

Gmail dots are removed on normalize email, other emails stays untouched.

Only problem… It looks like syntax changed a bit… normalize_email:!rd will throw an error:

Cannot create property 'all_lowercase' on string '!rd'

So take care :slight_smile:



Here are docs on same