diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java index 378ee0fa9..d7b9710c6 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java @@ -226,8 +226,6 @@ public class RegistrationController { throw new WebApplicationException("PNI keys and registration ID must be provided", 422); } - rateLimiters.getRegistrationLimiter().validate(number); - final PhoneVerificationRequest.VerificationType verificationType; try { verificationType = phoneVerificationTokenManager.verify( @@ -247,6 +245,8 @@ public class RegistrationController { throw new ForbiddenException("recovery password could not be verified"); } + rateLimiters.getRegistrationLimiter().validate(number); + // There can be at most one existing account for a set of numbers in the same equivalence class, so it's sufficient // to find the first one. final Optional existingAccount = Util.getAlternateForms(number)