Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,7 @@
"SIGNUP_FORM_EMAIL_DISPOSABLE_NOT_ALLOWED": "Temporary email addresses are not allowed",
"SIGNUP_FORM_EMAIL_INVALID": "Please enter a valid email address",
"SIGNUP_FORM_EMAIL_LABEL": "Work Email",
"SIGNUP_FORM_EMAIL_MUST_BE_A_WORK_EMAIL": "Oops! It looks like a personal email. Please use your work email.",
"SIGNUP_FORM_EMAIL_PLACEHOLDER": "Insert Email",
"SIGNUP_FORM_EMAIL_REQUIRED": "Email is required",
"SIGNUP_FORM_NAME_LABEL": "First name",
Expand Down
1 change: 1 addition & 0 deletions src/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,7 @@
"SIGNUP_FORM_EMAIL_DISPOSABLE_NOT_ALLOWED": "",
"SIGNUP_FORM_EMAIL_INVALID": "",
"SIGNUP_FORM_EMAIL_LABEL": "",
"SIGNUP_FORM_EMAIL_MUST_BE_A_WORK_EMAIL": "",
"SIGNUP_FORM_EMAIL_PLACEHOLDER": "",
"SIGNUP_FORM_EMAIL_REQUIRED": "",
"SIGNUP_FORM_NAME_LABEL": "",
Expand Down
58 changes: 57 additions & 1 deletion src/pages/JoinPage/SignupPage/validationSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,63 @@ export const getSignupValidationSchema = (t: TFunction) =>
Yup.object().shape({
email: Yup.string()
.email(t('SIGNUP_FORM_EMAIL_INVALID'))
.required(t('SIGNUP_FORM_EMAIL_REQUIRED')),
.required(t('SIGNUP_FORM_EMAIL_REQUIRED'))
.test(
'not-work-email',
t('SIGNUP_FORM_EMAIL_MUST_BE_A_WORK_EMAIL'),
(value) => {
if (!value) return true;
const invalidDomains = [
'gmail.com',
'googlemail.com',
'yahoo.com',
'yahoo.it',
'hotmail.com',
'hotmail.it',
'outlook.com',
'outlook.it',
'live.com',
'msn.com',
'icloud.com',
'me.com',
'mac.com',
'aol.com',
'protonmail.com',
'Proton: Privacy by default',
'gmx.com',
'gmx.net',
'mail.com',
'zoho.com',
'yandex.com',
'fastmail.com',
'tiscali.it',
'virgilio.it',
'libero.it',
'inwind.it',
'blu.it',
'email.it',
'tin.it',
'hotmail.fr',
'live.fr',
'outlook.fr',
'wanadoo.fr',
'orange.fr',
'free.fr',
'sfr.fr',
'laposte.net',
'bbox.fr',
'neuf.fr',
'numericable.fr',
'club-internet.fr',
'noos.fr',
'aliceadsl.fr',
'cegetel.net',
];
return !invalidDomains.some((domain) =>
value.toLowerCase().endsWith(`@${domain}`)
);
}
),
password: Yup.string()
.min(12, t('SIGNUP_FORM_PASSWORD_MUST_BE_AT_LEAST_12_CHARACTER_LONG'))
.matches(
Expand Down
Loading