Skip to content

Commit

Permalink
Merge pull request #144 from DimensionSrl/feature/updates
Browse files Browse the repository at this point in the history
Adds trimming to email check
  • Loading branch information
dulvui authored Mar 5, 2024
2 parents f208674 + 6b12ec0 commit ced088d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion NOICommunity/AuthFeature/LoadUserInfoViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ final class LoadUserInfoViewModel {
private extension Person {

func hasEmail(_ email: String) -> Bool {
let emails = [primaryEmail, secondaryEmail, tertiaryEmail].compactMap { $0 }
let email = email.trimmingCharacters(in: .whitespacesAndNewlines)
let emails = [primaryEmail, secondaryEmail, tertiaryEmail]
.compactMap { $0 }
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
return emails.contains { $0.compare(email, options: .caseInsensitive) == .orderedSame }
}
}
Expand Down

0 comments on commit ced088d

Please sign in to comment.