35 lines
961 B
Plaintext
35 lines
961 B
Plaintext
<CascadingAuthenticationState>
|
|
<RoleBasedRedirect/>
|
|
<Router AppAssembly="@typeof(Program).Assembly">
|
|
<Found Context="routeData">
|
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
|
|
<Authorizing>
|
|
<p>Loading...</p>
|
|
</Authorizing>
|
|
<NotAuthorized>
|
|
<NotAuthorizedHandler/>
|
|
</NotAuthorized>
|
|
</AuthorizeRouteView>
|
|
</Found>
|
|
<NotFound >
|
|
<LayoutView Layout="@typeof(MainLayout)">
|
|
<PageNotFoundHandler/>
|
|
</LayoutView>
|
|
</NotFound>
|
|
</Router>
|
|
</CascadingAuthenticationState>
|
|
|
|
|
|
@code {
|
|
|
|
private class RedirectToLogin : ComponentBase
|
|
{
|
|
[Inject] private NavigationManager Navigation { get; set; }
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
Navigation.NavigateTo("/login");
|
|
}
|
|
}
|
|
|
|
} |