1
This commit is contained in:
10
Yes.Blog/Endpoints/Admins/Auths/AuthEndpointScheme.cs
Normal file
10
Yes.Blog/Endpoints/Admins/Auths/AuthEndpointScheme.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Yes.Blog.Endpoints.Admins.Auths
|
||||
{
|
||||
public class AuthEndpointScheme
|
||||
{
|
||||
public int Priority { get; set; } = 3;
|
||||
public string Prefix { get; set; } = "admin/api";
|
||||
|
||||
public string[] Tags { get; set; } = new[] { "Auths" };
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Yes.Blog.Endpoints.Admins.Auths
|
||||
{
|
||||
public class UserLoginEndpoint : AdminEndpointScheme, IEndpoint
|
||||
public class UserLoginEndpoint : AuthEndpointScheme, IEndpoint
|
||||
{
|
||||
|
||||
public void Map(IEndpointRouteBuilder app) => app.MapPost("/login", Handle).WithRequestValidation<Request>();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace Yes.Blog.Endpoints.Admins.Auths
|
||||
{
|
||||
public class UserLogoutEndpoint : AdminEndpointScheme, IEndpoint
|
||||
public class UserLogoutEndpoint : AuthEndpointScheme, IEndpoint
|
||||
{
|
||||
|
||||
public void Map(IEndpointRouteBuilder app) => app.MapPost("/Logout", Handle);
|
||||
public void Map(IEndpointRouteBuilder app) => app.MapPost("/logout", Handle);
|
||||
|
||||
|
||||
private async Task<IResult> Handle(IMediator mediator, IMapper mapper, HttpContext context, CancellationToken cancellationToken)
|
||||
|
||||
Reference in New Issue
Block a user