diff options
| author | Jake Mannens <jake@asger.xyz> | 2026-05-08 01:30:38 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2026-05-08 01:30:38 +1000 |
| commit | a45ad8d3f8da273f80029ba6d34beb7e4ff7d7b5 (patch) | |
| tree | c28beb18ef41b997a234777a134c05c01802d5af /Program.cs | |
| parent | 2b66d00175950d845a794422433d4a350cf87775 (diff) | |
v0.14av0.14a
Diffstat (limited to 'Program.cs')
| -rw-r--r-- | Program.cs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -14,6 +14,7 @@ public class Program { builder.Services.AddHttpContextAccessor(); builder.Services.AddAuthentication( CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(); + builder.Services.AddAuthorization(); builder.Services.AddControllers().AddJsonOptions(o => { var converter = new JsonStringEnumConverter(); o.JsonSerializerOptions.Converters.Add(converter); @@ -49,12 +50,14 @@ public class Program { using var db = scope.ServiceProvider.GetRequiredService<HBContext>(); db.Database.Migrate(); + app.UseRouting(); app.UseSession(); + app.UseAuthentication(); + app.UseAuthorization(); app.UseHsts(); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseMiddleware<ExceptionMiddleware>(); - app.UseRouting(); app.MapBlazorHub(); app.MapControllers(); app.MapFallbackToPage("/_Host"); |
