Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Correct validator to use rfc822 email validation
Browse files Browse the repository at this point in the history
  • Loading branch information
rememberlenny committed Jun 23, 2017
1 parent c7dfc17 commit d80f623
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion static_src/util/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function validateString() {

export function validateEmail() {
return function _validateEmail(value, name) {
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value))) {
if (!(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/).test(value)) {
const nameString = (name ? `in ${name} ` : '');
return {
message: `The value entered ${nameString}is not a valid e-mail address`
Expand Down

0 comments on commit d80f623

Please sign in to comment.