Implemented Login workflow
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user