Fase 2: Creatción de la UI (React + Vite). Implementación de Log In reemplazando texto plano. Y creación de tool para migrar contraseñas.

This commit is contained in:
2025-05-05 15:49:01 -03:00
parent 9b1de95404
commit da7b544372
81 changed files with 12260 additions and 99 deletions

View File

@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations; // Para validaciones básicas
namespace GestionIntegral.Api.Dtos
{
public class LoginRequestDto
{
[Required]
[StringLength(20)]
public string Username { get; set; } = string.Empty;
[Required]
[StringLength(50, MinimumLength = 6)] // Ajustar el mínimo
public string Password { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,13 @@
namespace GestionIntegral.Api.Dtos
{
public class LoginResponseDto
{
public string Token { get; set; } = string.Empty; // El token JWT
public int UserId { get; set; }
public string Username { get; set; } = string.Empty;
public string NombreCompleto { get; set; } = string.Empty;
public bool EsSuperAdmin { get; set; }
public bool DebeCambiarClave { get; set; } // Para el primer login
// Se puede añadir más info si se necesita inmediatamente en el frontend (ej: IdPerfil)
}
}

View File

@@ -0,0 +1,17 @@
namespace GestionIntegral.Api.Models
{
public class Usuario
{
public int Id { get; set; }
public string User { get; set; } = string.Empty; // Renombrado de 'usuario' para evitar conflicto con la clase
public string ClaveHash { get; set; } = string.Empty; // Almacenará el HASH, no la clave
public string ClaveSalt { get; set; } = string.Empty; // Almacenará la SALT
public bool Habilitada { get; set; }
public bool SupAdmin { get; set; }
public string Nombre { get; set; } = string.Empty;
public string Apellido { get; set; } = string.Empty;
public int IdPerfil { get; set; }
public string VerLog { get; set; } = string.Empty;
public bool DebeCambiarClave { get; set; }
}
}