* Changed views to have them in the same layout
* Added Authorization
This commit is contained in:
20
OrdersManagement/Components/Pages/Main.razor
Normal file
20
OrdersManagement/Components/Pages/Main.razor
Normal file
@@ -0,0 +1,20 @@
|
||||
@page "/"
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
|
||||
@attribute [AllowAnonymous]
|
||||
|
||||
@inject CustomAuthenticationStateProvider CustomAuthenticationStateProvider
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@code {
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await CustomAuthenticationStateProvider.MarkUserAsLoggedOut();
|
||||
NavigationManager.NavigateTo("/login");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user