This commit is contained in:
Ccjcarkbla
2026-02-23 13:14:57 -05:00
parent 1a8d8fef70
commit 718ac72c57
8 changed files with 295 additions and 0 deletions
+15
View File
@@ -4,6 +4,7 @@ using maintenance.Authentication.Core;
using maintenance.Authentication.Providers.AdfsWsFed;
using maintenance.Authentication.Providers.Oidc;
using maintenance.Data;
using maintenance.Data.Seed;
using maintenance.Services.Templates;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
@@ -97,6 +98,20 @@ builder.Services.AddAuthorization(options =>
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
using var scope = app.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
try
{
await TemplateSeeder.SeedAsync(db);
}
catch
{
// Seed is best-effort for offline/dev environments.
}
}
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");