feat(mvp): complete Blazor UI + User Management + integration tests
This commit is contained in:
1 parent
b217c932e8
commit
38816aec8a
26 files changed
+1893
-45
No files matched your search
@@ -1,25 +1,47 @@
|
||||
using System.Security.Claims;
|
||||
using Heimdall.Web.Components;
|
||||
using Heimdall.Web.Services;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using MudBlazor.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
|
||||
// Auth for Blazor
|
||||
builder.Services.AddScoped<AuthenticationStateProvider, HeimdallAuthStateProvider>();
|
||||
builder.Services.AddAuthorizationCore();
|
||||
|
||||
builder.Services.AddMudServices(config =>
|
||||
{
|
||||
config.SnackbarConfiguration.PositionClass = "mud-alert-center-top";
|
||||
config.SnackbarConfiguration.PreventDuplicates = true;
|
||||
config.SnackbarConfiguration.ShowCloseIcon = true;
|
||||
config.SnackbarConfiguration.VisibleStateDuration = 4000;
|
||||
});
|
||||
|
||||
builder.Services.AddScoped<HeimdallApiClient>();
|
||||
builder.Services.AddHttpClient("HeimdallApi", client =>
|
||||
{
|
||||
client.BaseAddress = new Uri("http://localhost:5000/");
|
||||
client.Timeout = TimeSpan.FromSeconds(30);
|
||||
});
|
||||
|
||||
// Auth state
|
||||
builder.Services.AddScoped<AuthState>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAntiforgery();
|
||||
|
||||
app.MapStaticAssets();
|
||||
app.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode();
|
||||
|
||||
Reference in new issue
Block a user