impr: school email detection regex

!nuf
This commit is contained in:
Miodec 2024-07-30 22:04:39 +02:00
parent e55cd7bcb6
commit 20c2fbc116

View file

@ -81,7 +81,7 @@ const checkEmail = (): void => {
const email = $(".page.pageLogin .register.side .emailInput").val() as string;
const emailRegex =
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
const educationRegex = /@.*(education|\.edu$|\.edu\.|\.ac\.|\.sch\.)/i;
const educationRegex = /@.*(education|school|\.edu$|\.edu\.|\.ac\.|\.sch\.)/i;
const emailHasTypo = TypoList.some((typo) => {
return email.endsWith(typo);
@ -96,7 +96,7 @@ const checkEmail = (): void => {
} else if (educationRegex.test(email)) {
emailIndicator.show(
"edu",
"Some education emails will fail to receive our messages. Consider using a personal email address."
"Some education emails will fail to receive our messages, or disable the account as soon as you graduate. Consider using a personal email address."
);
} else {
emailIndicator.show("valid");