summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2026-05-08 01:30:38 +1000
committerJake Mannens <jake@asger.xyz>2026-05-08 01:30:38 +1000
commita45ad8d3f8da273f80029ba6d34beb7e4ff7d7b5 (patch)
treec28beb18ef41b997a234777a134c05c01802d5af /Program.cs
parent2b66d00175950d845a794422433d4a350cf87775 (diff)
v0.14av0.14a
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Program.cs b/Program.cs
index 34db56f..5863368 100644
--- a/Program.cs
+++ b/Program.cs
@@ -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");