Implemented Login workflow

This commit is contained in:
2025-11-30 15:19:49 +01:00
parent 2b5b0c1067
commit 825bd80ef0
22 changed files with 330 additions and 56 deletions

View File

@@ -1,3 +1,5 @@
using Microsoft.EntityFrameworkCore;
using SpotiParty.Web;
using SpotiParty.Web.Components;
using SpotiParty.Web.Services;
@@ -9,7 +11,8 @@ builder.Services.AddRazorComponents()
builder.AddServiceDefaults();
builder.Services.AddSingleton<AuthorizationHandler>();
builder.AddNpgsqlDbContext<DatabaseContext>("SpotiParty");
builder.Services.AddScoped<AuthorizationHandler>();
var app = builder.Build();
@@ -20,10 +23,15 @@ if (!app.Environment.IsDevelopment()) {
app.UseHsts();
}
await using (var scope = app.Services.CreateAsyncScope()) {
var context = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
await context.Database.MigrateAsync();
}
app.MapDefaultEndpoints();
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
app.UseHttpsRedirection();
//app.UseHttpsRedirection();
app.UseAntiforgery();