Skip to content

Commit

Permalink
[#IOPID-1885] check mail - case insensitive (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
gquadrati authored May 29, 2024
1 parent 00a1283 commit 5cdb9f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SanitizeProfileEmail/__tests__/handler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe("Given a list a profiles to be sanitized with their duplicated e-mail a
// 3. should have an item in the profile collection
const profiles: ProfileToSanitize[] = [
{
email: mocks.email,
email: mocks.email.toUpperCase() as EmailString,
fiscalCode: mocks.fiscalCodes.TO_SANITIZE
},
{
Expand Down
3 changes: 2 additions & 1 deletion SanitizeProfileEmail/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const getProfile = (fiscalCode: ProfileToSanitize["fiscalCode"]) => (
const isProfileEligibleForUpdate = (duplicatedEmail: EmailString) => (
profile: RetrievedProfile
): boolean =>
profile.isEmailValidated === true && profile.email === duplicatedEmail;
profile.isEmailValidated === true &&
profile.email?.toLowerCase() === duplicatedEmail.toLowerCase();

const getProfileForUpdate = (
profile: ProfileToSanitize
Expand Down

0 comments on commit 5cdb9f7

Please sign in to comment.