Skip to content

Commit

Permalink
Merge pull request #29929 from Expensify/marco-checkEmailPrincipal
Browse files Browse the repository at this point in the history
Check if principal's email is public
  • Loading branch information
srikarparsi authored Dec 14, 2023
2 parents d9f8772 + c10bfff commit 70e7ec3
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 @@ -14,6 +14,7 @@ import TextInput from '@components/TextInput';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import * as ErrorUtils from '@libs/ErrorUtils';
import * as LoginUtils from '@libs/LoginUtils';
import Navigation from '@libs/Navigation/Navigation';
import * as ValidationUtils from '@libs/ValidationUtils';
import TeachersUnite from '@userActions/TeachersUnite';
Expand Down Expand Up @@ -76,6 +77,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 70e7ec3

Please sign in to comment.