* Turned off Login as it is not working
This commit is contained in:
@@ -16,23 +16,23 @@
|
||||
<img src="logo.svg" class="me-2" width="35" height="35" alt="Icon">
|
||||
<h3 class="text-primary m-0">FA Krosno Manager</h3>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
@if (IsAuthenticated)
|
||||
{
|
||||
<span class="me-2">Jesteś zalogowany jako <strong>@UserName</strong></span>
|
||||
<SfButton CssClass="e-primary" IsPrimary="true" @onclick="Logout">Wyloguj</SfButton>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a href="/login" class="text-muted">Zaloguj</a>
|
||||
}
|
||||
</div>
|
||||
@* <div class="d-flex align-items-center"> *@
|
||||
@* @if (IsAuthenticated) *@
|
||||
@* { *@
|
||||
@* <span class="me-2">Jesteś zalogowany jako <strong>@UserName</strong></span> *@
|
||||
@* <SfButton CssClass="e-primary" IsPrimary="true" @onclick="Logout">Wyloguj</SfButton> *@
|
||||
@* } *@
|
||||
@* else *@
|
||||
@* { *@
|
||||
@* <a href="/login" class="text-muted">Zaloguj</a> *@
|
||||
@* } *@
|
||||
@* </div> *@
|
||||
</div>
|
||||
<div class="row gx-1 flex-grow-1">
|
||||
<div class="col-auto custom-menu-width">
|
||||
<SfMenu TValue="MenuItem" HamburgerMode="true" Orientation="Vertical" Title="Menu">
|
||||
<MenuItems>
|
||||
<MenuItem Text="Zamówienia DELFOR" Url="/ScheduleOrders" IconCss="fa-solid fa-landmark"></MenuItem>
|
||||
<MenuItem Text="Zamówienia DELFOR" Url="/" IconCss="fa-solid fa-landmark"></MenuItem>
|
||||
<MenuItem Text="Zamówienia klienta EDI" Url="/EdiCustomerOrders" IconCss="fa-solid fa-list-check"></MenuItem>
|
||||
<MenuItem Text="Zamówienia klienta" Url="/CustomerOrders" IconCss="fa-solid fa-database"></MenuItem>
|
||||
@if (UserName == "pkus")
|
||||
@@ -64,11 +64,11 @@
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
ClaimsPrincipal currentUser = AuthenticationStateProvider.GetCurrentUser();
|
||||
IsAuthenticated = currentUser.Identity?.IsAuthenticated == true;
|
||||
UserName = currentUser.Identity?.Name ?? "Nieznany użytkownik";
|
||||
|
||||
AuthenticationStateProvider.AuthenticationStateChanged += OnAuthenticationStateChanged;
|
||||
// ClaimsPrincipal currentUser = AuthenticationStateProvider.GetCurrentUser();
|
||||
// IsAuthenticated = currentUser.Identity?.IsAuthenticated == true;
|
||||
// UserName = currentUser.Identity?.Name ?? "Nieznany użytkownik";
|
||||
//
|
||||
// AuthenticationStateProvider.AuthenticationStateChanged += OnAuthenticationStateChanged;
|
||||
}
|
||||
|
||||
private async void OnAuthenticationStateChanged(Task<AuthenticationState> task)
|
||||
|
||||
Reference in New Issue
Block a user