Open
Description
Summary
Currently, the AuthenticationStateProvider.GetAuthenticationStateAsync() method is invoked automatically on all pages, including those marked with [AllowAnonymous]. This leads to unnecessary token validations and refresh attempts even on pages that don't require authentication. This results in performance overhead, unwanted UI states like "Authorizing...", and possible JS interop issues during static rendering.
Proposal:
Provide a built-in way to skip or delay the GetAuthenticationStateAsync() call for anonymous pages, or allow developers to control when and where the authentication state is evaluated.