Add Update UI Patch
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 6m17s

This commit is contained in:
Leandro Hernan Rojas 2025-05-01 01:19:53 -03:00
parent b7c01e3a50
commit 5c2489b168
5 changed files with 23 additions and 19 deletions

View 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";
}
}

View File

@ -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>
&nbsp;Cerrar sesión
</a>
</Authorized>
<NotAuthorized>
<a href="Registro">Registrarse</a>
<a href="Login" class="nav-link btn btn-link">Ingresar</a>
</NotAuthorized>
</AuthorizeView>

View File

@ -22,7 +22,7 @@
</PhToggle> </PhToggle>
</div> </div>
<div class="col-md-8" style="text-align: right;"> <div class="col-md-8" style="text-align: right;">
<LoginView /> <PhLoginState/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -26,8 +26,4 @@
<ProjectReference Include="..\Transversal\Transversal.csproj" /> <ProjectReference Include="..\Transversal\Transversal.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
</ItemGroup>
</Project> </Project>