Changes
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user