Add Update UI Patch
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 6m17s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 6m17s
This commit is contained in:
parent
b7c01e3a50
commit
5c2489b168
22
phronCare.UIBlazor/Shared/Components/PhLoginState.razor
Normal file
22
phronCare.UIBlazor/Shared/Components/PhLoginState.razor
Normal file
@ -0,0 +1,22 @@
|
||||
@using System.Security.Claims
|
||||
<AuthorizeView>
|
||||
<Authorized Context="authContext">
|
||||
<div class="d-flex justify-content-end align-items-center gap-3 px-3 py-2">
|
||||
<span class="fw-bold text-dark">
|
||||
Bienvenido, @GetUserDisplayName(authContext.User)
|
||||
</span>
|
||||
<a href="Logout" class="btn btn-sm btn-danger rounded-3 d-flex align-items-center gap-1 text-decoration-none">
|
||||
<i class="oi oi-account-logout"></i>
|
||||
<span>Cerrar sesión</span>
|
||||
</a>
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
@code {
|
||||
private string GetUserDisplayName(ClaimsPrincipal user)
|
||||
{
|
||||
return user.FindFirst("fullName")?.Value
|
||||
?? user.Identity?.Name
|
||||
?? "Usuario";
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<span>Bienvenido, @(context.User.FindFirst("fullName")?.Value ?? context.User.Identity?.Name)!</span>
|
||||
|
||||
<a href="Logout" class="btn-logout">
|
||||
<i class="oi oi-account-logout"></i>
|
||||
Cerrar sesión
|
||||
</a>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<a href="Registro">Registrarse</a>
|
||||
<a href="Login" class="nav-link btn btn-link">Ingresar</a>
|
||||
</NotAuthorized>
|
||||
</AuthorizeView>
|
||||
@ -22,7 +22,7 @@
|
||||
</PhToggle>
|
||||
</div>
|
||||
<div class="col-md-8" style="text-align: right;">
|
||||
<LoginView />
|
||||
<PhLoginState/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -26,8 +26,4 @@
|
||||
<ProjectReference Include="..\Transversal\Transversal.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Interfaces\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user