1
This commit is contained in:
19
Yes.Blog/Endpoints/Admins/Auths/UserLogoutEndpoint.cs
Normal file
19
Yes.Blog/Endpoints/Admins/Auths/UserLogoutEndpoint.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Yes.Blog.Endpoints.Admins.Auths
|
||||
{
|
||||
public class UserLogoutEndpoint : AdminEndpointScheme, IEndpoint
|
||||
{
|
||||
|
||||
public void Map(IEndpointRouteBuilder app) => app.MapPost("/Logout", Handle);
|
||||
|
||||
|
||||
private async Task<IResult> Handle(IMediator mediator, IMapper mapper, HttpContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
var command = new UserLogoutCommand();
|
||||
var response = await mediator.Send(command, cancellationToken);
|
||||
|
||||
await context.SignOut();
|
||||
|
||||
return Result.Ok(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user