From 4245717b59ad369003aece544b46e639eb099872 Mon Sep 17 00:00:00 2001 From: Brutus5000 Date: Thu, 16 Jan 2025 23:43:55 +0100 Subject: [PATCH] Check for blacklisted email domains Also disable instant check for email taken --- .../userservice/ui/view/registration/RegisterView.kt | 4 ++-- src/main/resources/i18n/messages.properties | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/faforever/userservice/ui/view/registration/RegisterView.kt b/src/main/kotlin/com/faforever/userservice/ui/view/registration/RegisterView.kt index a3c2001b..ade621cf 100644 --- a/src/main/kotlin/com/faforever/userservice/ui/view/registration/RegisterView.kt +++ b/src/main/kotlin/com/faforever/userservice/ui/view/registration/RegisterView.kt @@ -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") diff --git a/src/main/resources/i18n/messages.properties b/src/main/resources/i18n/messages.properties index ca278196..20651202 100644 --- a/src/main/resources/i18n/messages.properties +++ b/src/main/resources/i18n/messages.properties @@ -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