Add redirection to login
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
|
||||
<PageTitle>Тестирование экспорта</PageTitle>
|
||||
|
||||
<AuthorizeView>
|
||||
<RadzenSplitter Orientation="Orientation.Vertical" Style="height: 100%; border: 1px solid rgba(0,0,0,.08);">
|
||||
<RadzenSplitterPane Size="200px">
|
||||
<div style="height: 100%;overflow: auto;">
|
||||
@ -49,6 +50,7 @@
|
||||
<EventConsole @ref=@console />
|
||||
</RadzenSplitterPane>
|
||||
</RadzenSplitter>
|
||||
</AuthorizeView>
|
||||
|
||||
@code {
|
||||
EventConsole console = default!;
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
<Router AppAssembly="typeof(Program).Assembly">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
|
||||
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)">
|
||||
<NotAuthorized>
|
||||
<RedirectToLogin />
|
||||
</NotAuthorized>
|
||||
</AuthorizeRouteView>
|
||||
</Found>
|
||||
</Router>
|
||||
|
||||
8
Hcs.WebApp/Components/Shared/RedirectToLogin.razor
Normal file
8
Hcs.WebApp/Components/Shared/RedirectToLogin.razor
Normal file
@ -0,0 +1,8 @@
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@code {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
NavigationManager.NavigateTo($"account/login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user