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:
15
Backend/GestionIntegral.Api/Models/Dtos/LoginRequestDto.cs
Normal file
15
Backend/GestionIntegral.Api/Models/Dtos/LoginRequestDto.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
13
Backend/GestionIntegral.Api/Models/Dtos/LoginResponseDto.cs
Normal file
13
Backend/GestionIntegral.Api/Models/Dtos/LoginResponseDto.cs
Normal 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)
|
||||
}
|
||||
}
|
||||
17
Backend/GestionIntegral.Api/Models/Usuario.cs
Normal file
17
Backend/GestionIntegral.Api/Models/Usuario.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user