Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor AuthorizeRouteView not showing Authorizing Layout

$
0
0

I have a .NET 9 Blazor Maui hybrid application.

In my Routes.razor i have this:

<CascadingAuthenticationState><Router AppAssembly="typeof(MainLayout).Assembly"><Found Context="routeData"><AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"><NotAuthorized><RedirectToLogin /></NotAuthorized><Authorizing><LayoutView Layout="@typeof(AuthorizingScreen)"/></Authorizing></AuthorizeRouteView><FocusOnNavigate RouteData="routeData" Selector="h1"/></Found><NotFound><RedirectToError /></NotFound></Router></CascadingAuthenticationState>

My AuthorizingScreen.razor is not more than this:

@inherits LayoutComponentBase<MudLayout><MudMainContent><h3>Authorizing...</h3></MudMainContent></MudLayout>@code {}

And the RedirectToLogin just performs a routing to the LoginPage which has the @layout LoginLayout annotation.

So my problem here is that obviously the AuthorizingScreen never shows up.

When the Application loads I can see the MainLayout for a second and then I get redirected to the Login page.

All in all that's the desired behavior, except for the fact that you can see the main layout for a second.

Anybody got a clue?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>