Fix RLS permissions and JWT validation for admin club creation #5
@@ -143,8 +143,25 @@ app.MapGet("/weatherforecast", () =>
|
||||
})
|
||||
.WithName("GetWeatherForecast");
|
||||
|
||||
app.MapGet("/api/test", () => Results.Ok(new { message = "Test endpoint" }))
|
||||
.RequireAuthorization();
|
||||
app.MapGet("/api/debug/claims", (HttpContext context) =>
|
||||
{
|
||||
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.MapShiftEndpoints();
|
||||
|
||||
Reference in New Issue
Block a user