decePubClient/App.razor

27 lines
808 B
Plaintext
Raw Normal View History

2022-12-15 20:03:40 +01:00
<CascadingAuthenticationState>
<CascadingState>
2022-02-14 01:51:52 +01:00
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView DefaultLayout="@typeof(MainLayout)" RouteData="@routeData">
<NotAuthorized>
@if (context.User.Identity?.IsAuthenticated != true)
{
2022-12-15 20:03:40 +01:00
<RedirectToLogin />
2022-02-14 01:51:52 +01:00
}
else
{
<p role="alert">You are not authorized to access this resource.</p>
}
</NotAuthorized>
</AuthorizeRouteView>
2022-12-16 00:55:43 +01:00
<FocusOnNavigate RouteData="@routeData" Selector="a" />
2022-02-14 01:51:52 +01:00
</Found>
<NotFound>
<Title>Not found</Title>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
2022-12-15 20:03:40 +01:00
</CascadingState>
</CascadingAuthenticationState>