Add /api/pair-code (auth) + /api/pair (public) endpoints
This commit is contained in:
@@ -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 }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user