File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/routes/projectMemberInvites Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,12 @@ const addMemberValidations = {
40
40
const compareEmail = ( email1 , email2 , options = { UNIQUE_GMAIL_VALIDATION : false } ) => {
41
41
if ( options . UNIQUE_GMAIL_VALIDATION ) {
42
42
// email is gmail
43
- const emailSplit = / ( ^ [ \w . + - ] + ) ( @ g m a i l \. . * . ) $ / g. exec ( email1 ) ;
43
+ const emailSplit = / ( ^ [ \w . + - ] + ) ( @ g m a i l \. c o m | @ g o o g l e m a i l \. c o m ) $ / g. exec ( _ . toLower ( email1 ) ) ;
44
44
if ( emailSplit ) {
45
- const address = emailSplit [ 1 ] ;
46
- const emailDomain = emailSplit [ 2 ] ;
47
- const regexAddress = address . replace ( '.' , '' ) . split ( '' ) . join ( '\.?' ) ; // eslint-disable-line no-useless-escape
48
- const regex = new RegExp ( _ . toLower ( `${ regexAddress } ${ emailDomain } ` ) ) ;
45
+ const address = emailSplit [ 1 ] . replace ( '.' , '' ) ;
46
+ const emailDomain = emailSplit [ 2 ] . replace ( '.' , '\\.' ) ;
47
+ const regexAddress = address . split ( '' ) . join ( '\\ .?' ) ;
48
+ const regex = new RegExp ( `${ regexAddress } ${ emailDomain } ` ) ;
49
49
return regex . test ( _ . toLower ( email2 ) ) ;
50
50
}
51
51
}
You can’t perform that action at this time.
0 commit comments