-
-
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 fails with valid gmail address #865
Comments
Confirmed. $ yarn add validator
yarn add v1.7.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
Done in 0.59s.
$ node
> const isEmail = require("validator/lib/isEmail");
undefined
> isEmail("[email protected]");
false
> Confirmed. Looks like it's because the Gmail user validation doesn't allow underscores: https://github.com/chriso/validator.js/blob/9ad2034dceb340ac2f9d9103d392a19f4cffa785/src/lib/isEmail.js#L18 A quick trip around the internet confirms that this is, in fact, the case: Gmail doesn't let you create a username with an underscore. So that is, in fact, a valid email. |
@agsdtm7 your email is not valid, minimal address length for gmail is 6 characters. |
you are correct now it worked with 6 characters (or more) gmail addresses. Thanks for speedy reply |
@RobertFischer @tux-tn:
|
@patelnav see #832 (comment) for an example of gmail restricting usernames to [6,30] chars. Admittedly though, I don't know if this was always the case, or if there are valid, internal gmail addresses with < 6 chars. Either way, this has caused too many issues. I'll add a flag to control the behavior and default to the previous implementation. |
Does is mean Larry (Page) can't sign in in my application using validator.js? Hum, unless he is using [email protected] :) |
isEmail returns false for this address: [email protected]
The text was updated successfully, but these errors were encountered: