need server and core webapp to work at same time for testing purposes

This commit is contained in:
2026-05-03 18:04:40 -04:00
parent ec6a8c446a
commit 3460ce6b04
4 changed files with 15 additions and 4 deletions

View File

@@ -6,16 +6,21 @@ public static class AuthEndpoints
{
public static void MapAuthEndpoints(this WebApplication app)
{
app.MapPost("/user/signin", async (AuthSignin request, APIAuthService service) =>
app.MapPost("/user/signin", async (AuthSignin request, APIAuthService service, HttpContext context) =>
{
var token = await service.UserSigninAsync(request);
var ip = context.Connection.RemoteIpAddress?.MapToIPv4().ToString();
context.Request.Headers.TryGetValue("User-Agent", out var userAgent);
return token != null ? Results.Ok(token) : Results.Unauthorized();
Console.WriteLine($"IP:{ip}\nUserAgent:{userAgent}");
// var token = await service.UserSigninAsync(request, ip, userAgent);
// return token != null ? Results.Ok(token) : Results.Unauthorized();
return Results.Ok();
});
app.MapPost("/user/register", async (AuthRegister request, APIAuthService service) =>
{
var token = await service.UserRegisterAsync(request);
return token != null ? Results.Ok(token) : Results.Unauthorized();
return token != null ? Results.Ok(token) : Results.Unauthorized();
});
app.MapPost("/server/verify/user", async (AuthUserVerify request, APIAuthService service) =>
{