diff --git a/src/Heimdall.Web/Program.cs b/src/Heimdall.Web/Program.cs index 2654579..f9f7f7a 100644 --- a/src/Heimdall.Web/Program.cs +++ b/src/Heimdall.Web/Program.cs @@ -47,7 +47,11 @@ builder.Services.AddAuthorizationCore(); builder.Services.AddCascadingAuthenticationState(); // Blazor auth state provider (reads JWT from ProtectedLocalStorage) -builder.Services.AddScoped(); +// Register the concrete type so @inject HeimdallAuthStateProvider works in pages, +// then make the base AuthenticationStateProvider resolve to the same instance. +builder.Services.AddScoped(); +builder.Services.AddScoped( + sp => sp.GetRequiredService()); // ── MudBlazor ───────────────────────────────────────────────────── builder.Services.AddMudServices(config =>