-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isEmail should check specific gmail case only under option #853
Comments
Hello towc I am the person who added gmail validation to isEmail. |
as mentioned:
And if the idea is to allow gmail, why stop there and not add other common providers? If you actually want specific validation, it means that the code that uses I'm not trying to undervalue your contribution, but there were various commits because the validation didn't account for some stuff, until someone mentioned it. It's not that you didn't do your research, but it shows a deeper problem with maintaining these things. I don't think it's this library's place to do these kinds of checks by default. Or at the very least we could have an option to skip them, so the default remains the same, but it still makes it unintuitive and cause for confusion |
I think you'll understand better why gmail validation has been added to isEmail by taking a look at #825 |
oh, thanks, I hadn't read that. Either way, |
ran into the same issue as @towc. I think it make's sense to have provider specific validation enable by default but it would be nice to pass options to disable the additional validation for all providers or specific providers if required. |
even updating the isEmail description in the Validators list to detail what validation is occurring for each provider would be a step in the right direction... opposed to finding this out during implementation. |
@tux-tn it’s possible there are some gmail users who have addresses that were valid at the time that wouldn’t be allowed today. Perhaps the more strict validation was added later, but we are still left with the possibility that these emails exist legitimately. See my comment here for more info I hope an option can be added to disable these kind of domain specific checks, otherwise I will have to add logic to optionally do it outside of this library. |
@tux-tn ah, thank you! Sorry for the trouble. |
@tux-tn Why was this removed from the subsequent versions? For example |
I think it's weird to only have some rules about gmail, which might require more maintenance, create bugs, and in my case, a bit of confusion.
I was writing some tests, and one of them used the email "[email protected]", but the test didn't pass. It took me a bit to figure out that the problem was actually with validator not allowing gmail usernames to be outside of the 6-30 range length.
It's still nice to have some additional checks, but maybe I'd only put them under an option?
validator.isEmail(email, { domainChecks: true })
or similar.Agree or disagree? Would it make anyone's code incompatible or work worse, if it's not the default?
The text was updated successfully, but these errors were encountered: