* Turned off Login as it is not working

This commit is contained in:
2025-03-01 06:35:28 +01:00
parent b8fbb789ad
commit f321677447
19 changed files with 122 additions and 154 deletions

View File

@@ -1,7 +1,5 @@
@page "/Admin/Scheduler"
@attribute [Authorize]
@using System.Security.Claims
@using Microsoft.AspNetCore.Authorization
@using OrdersManagementDataModel.Dtos
@@ -60,17 +58,17 @@
{
if (firstRender)
{
ClaimsPrincipal currentUser = CustomAuthenticationStateProvider.GetCurrentUser();
if (currentUser.Identity?.IsAuthenticated == false || currentUser.Identity?.Name != "pkus")
{
NavigationManager.NavigateTo("/Unauthorized");
}
else
{
// ClaimsPrincipal currentUser = CustomAuthenticationStateProvider.GetCurrentUser();
//
// if (currentUser.Identity?.IsAuthenticated == false || currentUser.Identity?.Name != "pkus")
// {
// NavigationManager.NavigateTo("/Unauthorized");
// }
// else
// {
await LoadTasks();
StateHasChanged();
}
// }
}
}

View File

@@ -1,7 +1,5 @@
@page "/admin/UsersManager"
@attribute [Authorize]
@using System.Security.Claims
@using Microsoft.AspNetCore.Authorization
@using OrdersManagementDataModel.Dtos
@@ -136,19 +134,19 @@
if (firstRender)
{
Visibility = false;
ClaimsPrincipal currentUser = CustomAuthenticationStateProvider.GetCurrentUser();
if (currentUser.Identity?.IsAuthenticated == false || currentUser.Identity?.Name != "pkus")
{
NavigationManager.NavigateTo("/Unauthorized");
}
else
{
// ClaimsPrincipal currentUser = CustomAuthenticationStateProvider.GetCurrentUser();
//
// if (currentUser.Identity?.IsAuthenticated == false || currentUser.Identity?.Name != "pkus")
// {
// NavigationManager.NavigateTo("/Unauthorized");
// }
// else
// {
await LoadUsers();
await LoadRoles();
//await LoadFunctions();
StateHasChanged();
}
// }
}
}

View File

@@ -1,7 +1,5 @@
@page "/CustomerOrder/{CustomerOrderId:guid}"
@attribute [Authorize]
@inject CustomerOrderService CustomerOrderService
@inject ScheduleOrderService ScheduleOrderService
@inject NavigationManager NavigationManager
@@ -224,14 +222,14 @@
StateHasChanged();
_isVisible = false;
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
// {
CustomerOrderDto? customerOrder = await CustomerOrderService.GetCustomerOrderAsync(CustomerOrderId);
if (customerOrder != null)
@@ -239,7 +237,9 @@
CustomerOrderDto = customerOrder;
_customerOrderLines = CustomerOrderDto.CustomerOrderLines.ToList() ?? [];
}
}
StateHasChanged();
// }
}
}

View File

@@ -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();
}
// }
}
}

View File

@@ -1,7 +1,5 @@
@page "/EdiCustomerOrder/{CustomerOrderId:guid}"
@attribute [Authorize]
@inject EdiCustomerOrderService EdiCustomerOrderService
@inject NavigationManager NavigationManager
@inject CustomAuthenticationStateProvider CustomAuthenticationStateProvider
@@ -197,19 +195,20 @@
{
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
// {
EdiCustomerOrderDto? ediCustomerOrder = await EdiCustomerOrderService.GetEdiCustomerOrderAsync(CustomerOrderId);
EdiCustomerOrderDto = ediCustomerOrder;
_ediCustomerOrderLines = ediCustomerOrder?.EdiCustomerOrderLines.ToList() ?? [];
}
StateHasChanged();
// }
}
}

View File

@@ -1,7 +1,5 @@
@page "/EdiCustomerOrders"
@attribute [Authorize]
@inject EdiCustomerOrderService EdiCustomerOrderService
@inject NavigationManager NavigationManager
@inject CustomAuthenticationStateProvider CustomAuthenticationStateProvider
@@ -34,7 +32,7 @@
{
<div class="row mb-4">
<div class="col-md-12">
<SfButton CssClass="btn-primary" @onclick="SendOrderToSyteLine">@_text</SfButton>
<SfButton CssClass="e-primary" IsPrimary="true" @onclick="SendOrderToSyteLine">@_text</SfButton>
</div>
</div>
}
@@ -146,16 +144,16 @@
{
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
// {
await LoadData();
}
// }
}
}

View File

@@ -1,7 +1,5 @@
@page "/login"
@attribute [AllowAnonymous]
@using Microsoft.AspNetCore.Authorization
@using OrdersManagement.Models
@using Syncfusion.Blazor.Inputs
@@ -79,7 +77,7 @@
}
</CardContent>
<CardFooter>
<small class="text-muted">Orders Management System © @(DateTime.Now.Year)</small>
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
</CardFooter>
</SfCard>
</div>

View File

@@ -1,7 +1,6 @@
@page "/"
@page "/Main"
@using Microsoft.AspNetCore.Authorization
@attribute [AllowAnonymous]
@inject CustomAuthenticationStateProvider CustomAuthenticationStateProvider
@inject NavigationManager NavigationManager

View File

@@ -1,5 +1,4 @@
@page "/ScheduleOrder/{ScheduleOrderId:int}"
@attribute [Authorize]
@using System.Security.Claims
@using Microsoft.AspNetCore.Authorization
@@ -128,14 +127,14 @@
{
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
// {
ScheduleOrderDto = await ScheduleOrderService.GetScheduleOrderAsync(ScheduleOrderId);
_scheduleOrderDetails = ScheduleOrderDto?.ScheduleOrderDetails;
@@ -149,7 +148,7 @@
scheduleOrderDetailDto.RecipientName = ScheduleOrderDto?.RecipientName;
scheduleOrderDetailDto.PurchaserName = ScheduleOrderDto?.PurchaserCode;
}
}
// }
StateHasChanged();
}

View File

@@ -1,6 +1,4 @@
@page "/ScheduleOrders"
@attribute [Authorize]
@page "/"
@using System.Security.Claims
@using Microsoft.AspNetCore.Authorization
@@ -20,17 +18,17 @@
{
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
// {
_scheduleOrders = await FetchScheduleOrdersAsync();
StateHasChanged();
}
// }
}
}

View File

@@ -95,7 +95,7 @@
</SfGrid>
</CardContent>
<CardFooter>
<small class="text-muted">Orders Management System © @(DateTime.Now.Year)</small>
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
</CardFooter>
</SfCard>
</div>

View File

@@ -1,8 +1,6 @@
@page "/Unauthorized"
@using Microsoft.AspNetCore.Authorization
@attribute [AllowAnonymous]
@using Syncfusion.Blazor.Cards
@using Syncfusion.Blazor.Buttons
@@ -22,7 +20,7 @@
</SfButton>
</CardContent>
<CardFooter>
<small class="text-muted">Orders Management System © @(DateTime.Now.Year)</small>
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
</CardFooter>
</SfCard>
</div>