BlazorStart/Start/Client/App.razor
2021-12-08 22:24:42 -08:00

30 lines
1 KiB
Plaintext

<Fluxor.Blazor.Web.StoreInitializer />
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData">
<Authorizing>
<div class="text-center authorizingContainer">
<div class="loading loading-lg"></div>
Authorizing...
</div>
</Authorizing>
<NotAuthorized>
@if (!context.User.Identity?.IsAuthenticated ?? false)
{
<RedirectToLogin />
}
else
{
<p>You are not authorized to access this resource.</p>
}
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<p>Sorry, there's nothing at this address.</p>
</NotFound>
</Router>
</CascadingAuthenticationState>