Beginnings of Core Auth

This commit is contained in:
2026-04-30 19:08:37 -04:00
parent dd1aa45f6e
commit 33eee17c43
4 changed files with 98 additions and 10 deletions

View File

@@ -0,0 +1,57 @@
using RelayCore.Services;
namespace RelayCore.Endpoints;
public static class AuthEndpoints
{
public static void MapAuthEndpoints(this WebApplication app)
{
app.MapPost("/user/signin", async (AuthSignin request, APIAuthService service) =>
{
var token = await service.UserSigninAsync(request);
return token != null ? Results.Ok(token) : Results.Unauthorized();
});
app.MapPost("/user/register", async (AuthRegister request, APIAuthService service) =>
{
throw new NotImplementedException();
return Results.Ok();
});
app.MapPost("/server/verify/user", async (AuthUserVerify request, APIAuthService service) =>
{
throw new NotImplementedException();
});
app.MapPost("/server/user/profile", async (AuthUserVerify request, APIAuthService service) =>
{
throw new NotImplementedException();
});
app.MapPost("/server/verify/license", async (AuthServerLicense request, APIAuthService service) =>
{
throw new NotImplementedException();
});
}
}
public class AuthSignin
{
public string UserName { get; set; }
public string Password { get; set; }
}
public class AuthRegister
{
public string Username { get; set; }
public string Password { get; set; }
public string Email { get; set; }
}
public class AuthUserVerify
{
public string Username { get; set; }
public string Token { get; set; }
}
public class AuthServerLicense
{
public string License { get; set; }
}