Skip to content

Commit

Permalink
Check for blacklisted email domains
Browse files Browse the repository at this point in the history
Also disable instant check for email taken
  • Loading branch information
Brutus5000 committed Jan 16, 2025
1 parent eb409e7 commit 4245717
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ class RegisterView(
).bind("username")

binder.forField(email).withValidator(EmailValidator(getTranslation("register.email.invalid"))).withValidator(
{ email -> registrationService.emailAvailable(email) == EmailStatus.EMAIL_AVAILABLE },
getTranslation("register.email.taken"),
{ email -> registrationService.emailAvailable(email) != EmailStatus.EMAIL_BLACKLISTED },
getTranslation("register.email.blacklisted"),
).bind("email")

binder.forField(termsOfService).asRequired(getTranslation("register.acknowledge.terms")).bind("termsOfService")
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ register.password.confirm=Confirm Password
register.password.size=Password must be at least 6 characters
register.password.match=Passwords must match
register.email=Email
register.email.taken=Email is already registered to another user
register.email.blacklisted=The supplied email domain is blacklisted. Please use different email provider.
register.email.blacklisted=The supplied email domain is blacklisted. Please use a different email provider.
register.email.invalid=Email is not a valid address
register.readAndAgree=I have read and agree to the
register.termsOfService=Terms of Service
Expand Down

0 comments on commit 4245717

Please sign in to comment.