* Turned off Login as it is not working
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
@page "/CustomerOrders"
|
||||
|
||||
@attribute [Authorize]
|
||||
|
||||
@inject CustomerOrderService CustomerOrderService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject CustomAuthenticationStateProvider CustomAuthenticationStateProvider
|
||||
@@ -91,19 +89,19 @@
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
ClaimsPrincipal currentUser = CustomAuthenticationStateProvider.GetCurrentUser();
|
||||
|
||||
if (currentUser.Identity?.IsAuthenticated == false)
|
||||
{
|
||||
NavigationManager.NavigateTo("/Unauthorized");
|
||||
}
|
||||
else
|
||||
{
|
||||
// ClaimsPrincipal currentUser = CustomAuthenticationStateProvider.GetCurrentUser();
|
||||
//
|
||||
// if (currentUser.Identity?.IsAuthenticated == false)
|
||||
// {
|
||||
// NavigationManager.NavigateTo("/Unauthorized");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
_customerOrders = await CustomerOrderService.GetCustomerOrdersAsync() ?? new List<CustomerOrderDto>();
|
||||
_customerOrders = _customerOrders.OrderByDescending(x => x.CreateDate).ToList();
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user