Rework Admin UI #6

Merged
MasterMito merged 18 commits from epic/admin_rework_second_try into main 2026-03-20 11:55:38 +01:00
Showing only changes of commit b52d75591b - Show all commits
+19 -2
View File
@@ -143,8 +143,25 @@ app.MapGet("/weatherforecast", () =>
}) })
.WithName("GetWeatherForecast"); .WithName("GetWeatherForecast");
app.MapGet("/api/test", () => Results.Ok(new { message = "Test endpoint" })) app.MapGet("/api/debug/claims", (HttpContext context) =>
.RequireAuthorization(); {
var claims = context.User.Claims.Select(c => new { c.Type, c.Value }).ToList();
var realmAccess = context.User.FindFirst("realm_access")?.Value;
// Check if the authorization header is present
var authHeader = context.Request.Headers["Authorization"].FirstOrDefault();
return Results.Ok(new
{
isAuthenticated = context.User.Identity?.IsAuthenticated ?? false,
authenticationType = context.User.Identity?.AuthenticationType,
claimCount = claims.Count,
claims = claims,
realmAccess = realmAccess,
hasAuthHeader = !string.IsNullOrEmpty(authHeader),
authHeaderPrefix = authHeader?.Substring(0, Math.Min(20, authHeader?.Length ?? 0))
});
}).RequireAuthorization();
app.MapTaskEndpoints(); app.MapTaskEndpoints();
app.MapShiftEndpoints(); app.MapShiftEndpoints();