fix: remove UseStatusCodePagesWithReExecute — was turning 401 into 400

UseStatusCodePagesWithReExecute('/not-found') intercepts all 4xx
responses and re-executes the pipeline as POST /not-found.
Since /not-found is a Blazor component requiring antiforgery, the
re-executed POST would fail with 400 (no CSRF token).

API controllers now return proper 401/403 for unauthenticated
requests. All 61 integration tests pass.
This commit is contained in:
Arnaud Dartois committed 2026-07-21 07:38:38 +00:00
1 parent f7c5f7a80a
commit ed686718d3
2 files changed
+1 -1

No files matched your search

@@ -14,6 +14,7 @@ namespace Heimdall.Api.Controllers;
/// </summary>
[ApiController]
[Route("api/discovery")]
[Authorize(AuthenticationSchemes = "JwtBearer")]
[EnableRateLimiting("Api")]
public class DiscoveryController : ControllerBase
{