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
+3 -8
View File
@@ -1,9 +1,9 @@
using Api.Services.Contracts.Models;
using Api.Services.Contracts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Api.Models.Settings;
using Swashbuckle.AspNetCore.Annotations;
using Api.Models.Requests;
namespace Api.Controllers
{
@@ -29,7 +29,7 @@ namespace Api.Controllers
/// Returns the public reCAPTCHA site key used by the client to render the widget.
/// </summary>
[HttpGet]
[SwaggerOperation(Summary = "Get reCAPTCHA site key")]
[SwaggerOperation(Summary = "Get captcha site key")]
[ProducesResponseType(StatusCodes.Status200OK)]
public IActionResult GetSiteKey()
{
@@ -43,7 +43,7 @@ namespace Api.Controllers
[SwaggerOperation(Summary = "Verify captcha token")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> Verify([FromBody] VerifyRequest req, CancellationToken ct)
public async Task<IActionResult> Verify([FromBody] CaptchaVerifyRequest req, CancellationToken ct)
{
if (req is null || string.IsNullOrWhiteSpace(req.Token)) return BadRequest(new { error = "Missing token" });
@@ -57,10 +57,5 @@ namespace Api.Controllers
return Ok(verdict);
}
public sealed class VerifyRequest
{
public string? Token { get; set; }
}
}
}