mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
adjust cloud requirement to include user creation date (#2985)
This commit is contained in:
parent
e27ab5d6c3
commit
27e75e4459
@ -98,10 +98,11 @@ public class HCaptchaValidationService : ICaptchaValidationService
|
||||
|
||||
var failedLoginCeiling = _globalSettings.Captcha.MaximumFailedLoginAttempts;
|
||||
var failedLoginCount = user?.FailedLoginCount ?? 0;
|
||||
var cloudEmailUnverified = !_globalSettings.SelfHosted && !user.EmailVerified;
|
||||
var requireOnCloud = !_globalSettings.SelfHosted && !user.EmailVerified &&
|
||||
user.CreationDate < DateTime.UtcNow.AddHours(-24);
|
||||
return currentContext.IsBot ||
|
||||
_globalSettings.Captcha.ForceCaptchaRequired ||
|
||||
cloudEmailUnverified ||
|
||||
requireOnCloud ||
|
||||
failedLoginCeiling > 0 && failedLoginCount >= failedLoginCeiling;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user