When using auth, use CascadingAuthenticationState explicitly. Fixes #14566

This commit is contained in:
Steve Sanderson 2019-09-29 23:25:56 +01:00 committed by Artak
parent ebe81c2978
commit 00ebfb4811
1 changed files with 16 additions and 13 deletions

View File

@ -1,22 +1,25 @@
<Router AppAssembly="@typeof(Program).Assembly">
@*#if (NoAuth)
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
@*#if (!NoAuth)
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
#else
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
#endif*@
</Found>
<NotFound>
@*#if (!NoAuth)
<CascadingAuthenticationState>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</CascadingAuthenticationState>
#else
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
#endif*@
</NotFound>
</Router>
#else
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
#endif*@