Skip to content

Commit

Permalink
Merge pull request #283 from mild-blue/hotflix-mail
Browse files Browse the repository at this point in the history
[HOTFIX] email to lowercase
  • Loading branch information
LukasForst authored Jun 7, 2021
2 parents 242ed98 + 1b7d675 commit c74a6c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class PatientService(
phoneNumber = registration.phoneNumber.formatPhoneNumber(),
personalNumber = registration.personalNumber?.normalizePersonalNumber(),
insuranceNumber = registration.insuranceNumber?.trim(),
email = registration.email.trim().lowercase(Locale.getDefault()),
email = registration.email.trim().lowercase(),
insuranceCompany = registration.insuranceCompany,
indication = registration.indication?.trim(),
remoteHost = registrationDto.remoteHost,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class ValidationService(private val questionService: QuestionService) {
* Throws [PropertyValidationException] if the value is invalid.
*/
fun requireValidEmail(email: String) {
if (!isEmailValid(email.trim())) {
if (!isEmailValid(email.trim().lowercase())) {
throw PropertyValidationException("email", email)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ class ValidationServiceTest {
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"
]
)
fun `test valid email`(validEmail: String) {
Expand Down

0 comments on commit c74a6c3

Please sign in to comment.