Fixed some critical bugs

This commit is contained in:
Spencer Twaddle
2026-05-02 15:50:03 -05:00
parent 6d1bc2ce2c
commit 71bd88ace9
3 changed files with 7 additions and 5 deletions
+5 -3
View File
@@ -22,11 +22,14 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
{
options.Authority = builder.Configuration["AUTH__AUTHORITY"];
options.Audience = builder.Configuration["AUTH__AUDIENCE"];
options.MapInboundClaims = false;
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidateAudience = true,
ValidateLifetime = true,
RoleClaimType = "role",
NameClaimType = "sub",
};
});
@@ -49,9 +52,8 @@ app.UseDefaultFiles();
app.UseStaticFiles();
app.UseAuthentication();
app.UseAuthorization();
app.UseMiddleware<KnownUserMiddleware>();
app.UseAuthorization();
app.MapControllers();
app.MapHealthChecks("/healthz", new HealthCheckOptions
@@ -62,7 +64,7 @@ app.MapHealthChecks("/healthz", new HealthCheckOptions
[HealthStatus.Degraded] = StatusCodes.Status200OK,
[HealthStatus.Unhealthy] = StatusCodes.Status503ServiceUnavailable,
}
}).RequireAuthorization();
});
app.MapFallbackToFile("index.html");