18 lines
541 B
C#
18 lines
541 B
C#
using FastEndpoints;
|
|
|
|
namespace SpaceGame.Api.Auth.Api;
|
|
|
|
public sealed class ForgotPasswordHandler(AuthService authService) : Endpoint<ForgotPasswordRequest, ForgotPasswordResponse>
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Post("/api/auth/forgot-password");
|
|
AllowAnonymous();
|
|
}
|
|
|
|
public override async Task HandleAsync(ForgotPasswordRequest request, CancellationToken cancellationToken)
|
|
{
|
|
await SendOkAsync(await authService.ForgotPasswordAsync(request, cancellationToken), cancellationToken);
|
|
}
|
|
}
|