mirror of
https://github.com/bitwarden/server.git
synced 2025-04-06 05:28:15 -05: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 failedLoginCeiling = _globalSettings.Captcha.MaximumFailedLoginAttempts;
|
||||||
var failedLoginCount = user?.FailedLoginCount ?? 0;
|
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 ||
|
return currentContext.IsBot ||
|
||||||
_globalSettings.Captcha.ForceCaptchaRequired ||
|
_globalSettings.Captcha.ForceCaptchaRequired ||
|
||||||
cloudEmailUnverified ||
|
requireOnCloud ||
|
||||||
failedLoginCeiling > 0 && failedLoginCount >= failedLoginCeiling;
|
failedLoginCeiling > 0 && failedLoginCount >= failedLoginCeiling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user