Skip to content

Commit

Permalink
check if principal's email is public
Browse files Browse the repository at this point in the history
  • Loading branch information
marcochavezf committed Oct 19, 2023
1 parent c23adc0 commit 657c102
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/TeachersUnite/IntroSchoolPrincipalPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Navigation from '../../libs/Navigation/Navigation';
import TeachersUnite from '../../libs/actions/TeachersUnite';
import useLocalize from '../../hooks/useLocalize';
import * as ValidationUtils from '../../libs/ValidationUtils';
import * as LoginUtils from '../../libs/LoginUtils';

const propTypes = {
/** Login list for the user that is signed in */
Expand Down Expand Up @@ -74,6 +75,9 @@ function IntroSchoolPrincipalPage(props) {
if (!_.isEmpty(values.partnerUserID) && !Str.isValidEmail(values.partnerUserID)) {
ErrorUtils.addErrorMessage(errors, 'partnerUserID', translate('teachersUnitePage.error.enterValidEmail'));
}
if (!_.isEmpty(values.partnerUserID) && LoginUtils.isEmailPublicDomain(values.partnerUserID)) {
ErrorUtils.addErrorMessage(errors, 'partnerUserID', translate('teachersUnitePage.error.tryDifferentEmail'));
}

return errors;
},
Expand Down

0 comments on commit 657c102

Please sign in to comment.