From 27e75e445984958dd890970325612b7cd8b76898 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 8 Jun 2023 11:43:29 -0400 Subject: [PATCH] adjust cloud requirement to include user creation date (#2985) --- .../Services/Implementations/HCaptchaValidationService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Core/Auth/Services/Implementations/HCaptchaValidationService.cs b/src/Core/Auth/Services/Implementations/HCaptchaValidationService.cs index 0c3ad1a51..cdd6c2017 100644 --- a/src/Core/Auth/Services/Implementations/HCaptchaValidationService.cs +++ b/src/Core/Auth/Services/Implementations/HCaptchaValidationService.cs @@ -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; }