Add /api/pair-code (auth) + /api/pair (public) endpoints

This commit is contained in:
2026-06-11 18:56:41 +00:00
parent db5c4e59a4
commit b5be4c6914
3 changed files with 125 additions and 0 deletions
+5
View File
@@ -1,5 +1,6 @@
using backend.Auth;
using backend.Data;
using backend.Pairing;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
@@ -10,6 +11,9 @@ builder.Services.AddDbContext<AppDbContext>(opt =>
builder.Services.AddAppIdentity();
builder.Services.AddAuthorization();
builder.Services.AddScoped<backend.Devices.DeviceTokenService>();
builder.Services.AddScoped<backend.Pairing.PairingService>();
var app = builder.Build();
using (var scope = app.Services.CreateScope())
@@ -30,6 +34,7 @@ app.UseAuthentication();
app.UseAuthorization();
app.MapAuthEndpoints();
app.MapPairingEndpoints();
app.MapGet("/health", () => Results.Ok(new { ok = true }));