[nodebb-plugin-email] Check user's email if it is valid to sign up
-
I finally have created one plugin with help from my friends(from this forum) that checks if the user's email is valid to sign up. For example, if it contains '.edu' or company email extension.
Github LinkThis is my first NodeBB plugin
-
@limker said:
Looks like your plugin will reject any user with a non-gmail account. Maybe you should check with a list of valid email domains, i'm sure you can find one easily on google.
I recall the readme saying that you need to change the library.js file or whatever it's called from gmail to whatever domain you want. Pretty sure you could comma delimit it, but not sure. Should probably include an admin ACP settings page to make it easier.
-
@limker said:
Looks like your plugin will reject any user with a non-gmail account. Maybe you should check with a list of valid email domains, i'm sure you can find one easily on google.
Actually I think this is a bad idea. Because anyone can run their own mailserver.
Just check if the email contains an @ is enough for valid email testing. Most regex solutions will fail on stuff like:
"this email contains spaces"@example.org
which is a valid email address. An email address may even contain a@
character in the local part in some odd configurations.