Vee-validate: Email Validation incorrect

Created on 30 May 2018  Â·  5Comments  Â·  Source: logaretm/vee-validate

Versions

  • vee-validate: 2.0.0-rc.26
  • vue: 2.5.9

Describe the bug
Since our mail client isn't SMTPUTF8-aware it can't handle UTF-8 encoded email addresses. Vee Validate seems to accept UTF-8 in email validation rule (which is an SMTP Extension: RFC 6531). We need a way to configure that rule to don't accept every UTF-8 character.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Vee Validate Documentation for email rule: https://baianat.github.io/vee-validate/guide/rules.html#email
  2. Enter invalid email address: föö@bar.de
  3. No validation error

Expected behavior
Since the email address is invalid it should give a validation error

Demo Link
https://baianat.github.io/vee-validate/guide/rules.html#email

Desktop (please complete the following information):

  • OS: Windows 7 Enterprise
  • Browser: Chrome 66.0.3359.181
☔ has workaround ✨ enhancement

Most helpful comment

@toadkicker Sorry I didn't see your comment, but the gmail emails require more than 5 characters in the identifier to be valid so [email protected] is actually invalid. We use validator.js for email validation and a couple of other validations.

All 5 comments

You could overwrite the rule with your own implementation at the moment. as vee-validate uses the validator.js isEmail method to check for valid emails which allows utf-8 chars by default.

Replace it with a rule that passes the allow_utf8_local_part to the underlying validator function.

 validator.isEmail('föö@bar.de', {
  allow_utf8_local_part: true
});

screen shot 2018-07-22 at 14 17 56
This should definitely work but it shows invalid. Happens in my own app as well.

@toadkicker Sorry I didn't see your comment, but the gmail emails require more than 5 characters in the identifier to be valid so [email protected] is actually invalid. We use validator.js for email validation and a couple of other validations.

Thanks that is helpful!

closed by 2165754

Was this page helpful?
0 / 5 - 0 ratings