mirror of
https://github.com/PacktPublishing/Web-Development-with-Blazor-Second-Edition.git
synced 2025-12-06 05:32:03 +01:00
24 lines
1 KiB
Plaintext
24 lines
1 KiB
Plaintext
|
|
@using Microsoft.AspNetCore.Components.Authorization
|
||
|
|
<CascadingAuthenticationState>
|
||
|
|
<Router AppAssembly="@typeof(App).Assembly" AdditionalAssemblies="new[] { typeof(Components.Pages.Index).Assembly}">
|
||
|
|
<Found Context="routeData">
|
||
|
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
|
||
|
|
<Authorizing>
|
||
|
|
<p>Determining session state, please wait...</p>
|
||
|
|
</Authorizing>
|
||
|
|
<NotAuthorized>
|
||
|
|
<h1>Sorry</h1>
|
||
|
|
<p>You're not authorized to reach this page. You need to log in.</p>
|
||
|
|
</NotAuthorized>
|
||
|
|
</AuthorizeRouteView>
|
||
|
|
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
||
|
|
</Found>
|
||
|
|
<NotFound>
|
||
|
|
<PageTitle>Not found</PageTitle>
|
||
|
|
<LayoutView Layout="@typeof(MainLayout)">
|
||
|
|
<p role="alert">Sorry, there's nothing at this address.</p>
|
||
|
|
</LayoutView>
|
||
|
|
</NotFound>
|
||
|
|
</Router>
|
||
|
|
</CascadingAuthenticationState>
|