waiap / javascript-sdk

Payment Wall SDK en JavaScript
0 stars 1 forks source link

Emails with tlds longer than 3 letters wont pass validation #1

Open XayOn opened 4 years ago

XayOn commented 4 years ago

As it can bee seen on IANA's TLD list, a lot of domains are more than 3-letter lenght. https://data.iana.org/TLD/tlds-alpha-by-domain.txt

On client.js, the email validation only allows 3 letter tlds.

https://github.com/waiap/javascript-sdk/blob/6ed91a12832dcfaa75169ee2b2e0243d9c1488b6/src/client.js#L12

XayOn commented 4 years ago

https://stackoverflow.com/questions/201323/how-to-validate-an-email-address-using-a-regular-expression (?:[a-z0-9!#$%&'*+/=?^_{|}~-]+(?:.[a-z0-9!#$%&'+/=?^_`{|}~-]+)|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])")@(?:(?:[a-z0-9](?:[a-z0-9-][a-z0-9])?.)+a-z0-9?|[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])).){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])`