blob: 1ad0f4737092b3863fbfdd3eb449dcb097732492 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
namespace IOL.GreatOffice.Api.Endpoints.Internal.PasswordResetRequests;
public class IsResetRequestValidRoute : RouteBaseAsync.WithRequest<Guid>.WithActionResult
{
private readonly PasswordResetService _passwordResetService;
public IsResetRequestValidRoute(PasswordResetService passwordResetService) {
_passwordResetService = passwordResetService;
}
[AllowAnonymous]
[HttpGet("~/_/password-reset-request/is-valid")]
public override async Task<ActionResult> HandleAsync(Guid id, CancellationToken cancellationToken = default) {
var request = await _passwordResetService.GetRequestAsync(id, cancellationToken);
if (request == default) {
return NotFound();
}
return Ok(request.IsExpired == false);
}
}
|