need server and core webapp to work at same time for testing purposes
This commit is contained in:
@@ -6,11 +6,16 @@ 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) =>
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ Console.WriteLine($"Kira created: {ToJsonString(kira)}");
|
||||
Console.WriteLine($"Test created: {ToJsonString(test)}");
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.WebHost.UseUrls("http://127.0.0.1:1337/");
|
||||
builder.Services.AddSingleton(db);
|
||||
builder.Services.AddScoped<APIAuthService>();
|
||||
|
||||
|
||||
@@ -14,4 +14,8 @@
|
||||
<PackageReference Include="SurrealDb.Net" Version="0.9.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\RelayShared\RelayShared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -21,6 +21,7 @@ var bootstrapService = new ServerBootstrapService(db, coreClient, cryptoService)
|
||||
await bootstrapService.InitializeAsync();
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.WebHost.UseUrls("http://127.0.0.1:5000/");
|
||||
|
||||
builder.Services.AddSingleton(db);
|
||||
builder.Services.AddScoped<RtcCallService>();
|
||||
|
||||
Reference in New Issue
Block a user