1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

hcaptcha validation on password login (#1398)

This commit is contained in:
Kyle Spearrin
2021-06-16 12:47:41 -04:00
committed by GitHub
parent 1796b1dd8e
commit d2e48a5c2c
8 changed files with 189 additions and 25 deletions

View File

@ -253,6 +253,16 @@ namespace Bit.Core.Utilities
{
services.AddSingleton<IReferenceEventService, AzureQueueReferenceEventService>();
}
if (!globalSettings.SelfHosted && CoreHelpers.SettingHasValue(globalSettings.Captcha?.HCaptchaSecretKey) &&
CoreHelpers.SettingHasValue(globalSettings.Captcha?.HCaptchaSiteKey))
{
services.AddSingleton<ICaptchaValidationService, HCaptchaValidationService>();
}
else
{
services.AddSingleton<ICaptchaValidationService, NoopCaptchaValidationService>();
}
}
public static void AddNoopServices(this IServiceCollection services)