2 ms·
> if (!user.email.includes("@")) return false I know this was't meant to be rock solid code, but I still thought it was a great example of why you shouldn't bo
by KPGv2 4mo ago
> if (!user.email.includes("@")) return false
I know this was't meant to be rock solid code, but I still thought it was a great example of why you shouldn't bother validating an email ever by looking at its construction, for any reason. Because "@" is not required for an email address! The very first check is already wrong :)
The proper way to validate email is to send an email with a link to validate it.