Skip to content

Commit

Permalink
better validate email addresses from forms
Browse files Browse the repository at this point in the history
prevents runtime exceptions like

EmailException: javax.mail.internet.AddressException: Local address ends
with dot in string `[email protected]`
  • Loading branch information
ornicar committed Oct 24, 2024
1 parent ea16f5e commit 7db5436
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/security/src/main/SecurityForm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ final class SecurityForm(
LilaForm
.cleanNonEmptyText(minLength = 6, maxLength = EmailAddress.maxLength)
.verifying(Constraints.emailAddress)
.verifying("error.email", EmailAddress.isValid)
.into[EmailAddress]

private val sendableEmail = anyEmail.verifying(emailValidator.sendableConstraint)
Expand Down

0 comments on commit 7db5436

Please sign in to comment.