2026-03-05 14:38:13 +01:00
|
|
|
using FluentValidation;
|
2026-04-07 14:23:29 +02:00
|
|
|
using Finch.Security;
|
2026-03-05 14:38:13 +01:00
|
|
|
|
2026-04-07 14:23:29 +02:00
|
|
|
namespace Finch.Validation;
|
2026-03-05 14:38:13 +01:00
|
|
|
|
|
|
|
|
public static partial class ValidatorExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Validates a captcha token
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IRuleBuilderOptions<T, string> Captcha<T>(this IRuleBuilder<T, string> ruleBuilder)
|
|
|
|
|
{
|
|
|
|
|
return ruleBuilder.SetAsyncValidator(new CaptchaValidator<T>());
|
|
|
|
|
}
|
|
|
|
|
}
|