1
0
mirror of https://github.com/bitwarden/server synced 2026-01-05 01:53:17 +00:00

Protect user registration with captcha (#1480)

* Protect user registration with captcha

* PR feedback
This commit is contained in:
Matt Gibson
2021-07-22 12:29:06 -05:00
committed by GitHub
parent 46fa6f6673
commit 7a135ae7cd
9 changed files with 64 additions and 13 deletions

View File

@@ -1,13 +1,14 @@
using System.Threading.Tasks;
using Bit.Core.Context;
using Bit.Core.Models.Table;
namespace Bit.Core.Services
{
public interface ICaptchaValidationService
{
bool ServiceEnabled { get; }
string SiteKey { get; }
bool RequireCaptcha { get; }
string SiteKeyResponseKeyName { get; }
bool RequireCaptchaValidation(ICurrentContext currentContext);
Task<bool> ValidateCaptchaResponseAsync(string captchResponse, string clientIpAddress);
string GenerateCaptchaBypassToken(User user);
bool ValidateCaptchaBypassToken(string encryptedToken, User user);