This commit is contained in:
2026-05-06 15:17:20 +03:00
parent 711810d8c2
commit a10908364b
9 changed files with 50 additions and 31 deletions
+1 -13
View File
@@ -19,26 +19,16 @@ namespace Api.Controllers
[EnableCors("FrontendOnly")]
public sealed class ContactController : ControllerBase
{
private readonly CaptchaSettings _captchaSettings;
private readonly ICaptchaVerifier _captcha;
private readonly IEmailSender _email;
private readonly ILogger<ContactController> _log;
public ContactController(IOptions<CaptchaSettings> options, ICaptchaVerifier captcha, IEmailSender email, ILogger<ContactController> log)
public ContactController(ICaptchaVerifier captcha, IEmailSender email, ILogger<ContactController> log)
{
_captchaSettings = options.Value;
_captcha = captcha;
_email = email;
_log = log;
}
/// <summary>
/// Returns the public reCAPTCHA site key used by the client to render
/// the reCAPTCHA widget and obtain client-side tokens.
/// </summary>
/// <returns>200 OK with the public site key as a string.</returns>
// ReCaptcha endpoints have been extracted to CaptchaController
/// <summary>
/// Validates the provided reCAPTCHA token and sends a contact message
/// via the configured email sender.
@@ -107,7 +97,5 @@ namespace Api.Controllers
}
}
// Captcha verification helper was moved to CaptchaController; ContactController calls _captcha.VerifyAsync directly.
}
}