mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 09:58:13 +01:00
Allow signup captchas to target CLDR two-letter region codes
This commit is contained in:
committed by
Jon Chambers
parent
d23e89fb9c
commit
b280c768a4
@@ -776,6 +776,8 @@ public class AccountController {
|
||||
}
|
||||
|
||||
final String countryCode = Util.getCountryCode(number);
|
||||
final String region = Util.getRegion(number);
|
||||
|
||||
if (captchaToken.isPresent()) {
|
||||
boolean validToken = recaptchaClient.verify(captchaToken.get(), sourceHost);
|
||||
|
||||
@@ -822,7 +824,9 @@ public class AccountController {
|
||||
|
||||
DynamicCaptchaConfiguration captchaConfig = dynamicConfigurationManager.getConfiguration()
|
||||
.getCaptchaConfiguration();
|
||||
boolean countryFiltered = captchaConfig.getSignupCountryCodes().contains(countryCode);
|
||||
|
||||
boolean countryFiltered = captchaConfig.getSignupCountryCodes().contains(countryCode) ||
|
||||
captchaConfig.getSignupRegions().contains(region);
|
||||
|
||||
if (abusiveHostRules.isBlocked(sourceHost)) {
|
||||
blockedHostMeter.mark();
|
||||
|
||||
Reference in New Issue
Block a user