Blazor8Test icon indicating copy to clipboard operation
Blazor8Test copied to clipboard

Reorder UseAuthorization after UseStatusCodePagesWithRedirects

Open halter73 opened this issue 2 years ago • 0 comments

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.

halter73 avatar Nov 04 '23 23:11 halter73