Blazor8Test
Blazor8Test copied to clipboard
Reorder UseAuthorization after UseStatusCodePagesWithRedirects
WebApplication's automatic UseAuthorization() insertion happens before the user-configured UseStatusCodePagesWithRedirecte(). By adding UseAuthorization() explicitly, we can ensure UseStatusCodePagesWithRedirecte() "sees" unauthorized requests.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/middleware?view=aspnetcore-8.0
This should address this issue described in https://github.com/dotnet/aspnetcore/issues/49515.