mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-11-30 01:16:50 +00:00
Move number rate-limiting after verification
This commit is contained in:
1 parent
4c2cd0c999
commit
a5f2f7f3e5
1 file changed
+2
-2
+2
-2
@@ -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<Account> existingAccount = Util.getAlternateForms(number)
|
||||
|
||||
Reference in new issue
Block a user