diff --git a/backend/src/components/permissionUtils.js b/backend/src/components/permissionUtils.js index 4c84d3ea2..598fc0d0f 100644 --- a/backend/src/components/permissionUtils.js +++ b/backend/src/components/permissionUtils.js @@ -328,6 +328,9 @@ function findSInstituteTypeCollectionID_body(req, res, next) { } function checkStudentBelongsInCollection(req, res, next) { + if (!res.locals.requestedSdcSchoolCollectionStudentID) { + return next(); + } if(res.locals.requestedInstituteType === 'DISTRICT') { return checkIfStudentBelongsInDistrictCollection(req, res, next); } else { diff --git a/frontend/src/components/admin/InviteUserPage.vue b/frontend/src/components/admin/InviteUserPage.vue index 251e22656..d1d7ca1ae 100644 --- a/frontend/src/components/admin/InviteUserPage.vue +++ b/frontend/src/components/admin/InviteUserPage.vue @@ -233,7 +233,7 @@ export default { emailRules() { return [ v => !!v || this.emailHint, - v => /^[\w!#$%&’*+/=?`{|}~^-]+(?:\.[\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$/.test(v) || this.emailHint, + v => /^[\w!#$%&’*+/=?`{|}~^-]+(?:\.[\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,63}$/.test(v) || this.emailHint, ]; } }, diff --git a/frontend/src/utils/institute/formRules.js b/frontend/src/utils/institute/formRules.js index 7f6c3121b..1f733ded7 100644 --- a/frontend/src/utils/institute/formRules.js +++ b/frontend/src/utils/institute/formRules.js @@ -20,7 +20,7 @@ import {LocalDate} from '@js-joda/core'; * @returns Function */ const email = (message = 'E-mail must be valid') => { - return v => !v || /^(?=[A-Za-z0-9][A-Za-z0-9@._%+-]{5,253}$)[A-Za-z0-9._%+-]{1,64}@(?:(?=[A-Za-z0-9-]{1,63}\.)[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\.){1,8}[A-Za-z]{2,63}$/.test(v) || message; + return v => !v || /^[\w!#$%&’*+/=?`{|}~^-]+(?:\.[\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,63}$/.test(v) || message; }; /**