Alinear BD local con esquema de produccion, login offline y publicacion portable
- Modelos renombrados para coincidir con columnas de MariaDB (ApPaterno/ApMaterno, HoraSalida, FechaFin, IdAsistenciaProfesor) - Agregado campo IdAlumno a DetalleContrato - Seed data con IDs reales de produccion (16451, 16493, profesor 15668563-1) - Login offline: solo valida RUT contra BD local, sin contraseña - ConnectivityService: checkea internet al inicio, bloquea si hay conexion - ViewLocator corregido: busca tipos en todos los ensamblados - Todos los ViewModels heredan de ViewModelBase - Publicacion self-contained para win-x64, linux-x64, osx-x64, osx-arm64 - Agregado .gitignore, removidos bin/obj/publish del tracking
This commit is contained in:
1 parent
9068122b6b
commit
fb275508ee
19 files changed
+196
-77
No files matched your search
@@ -17,21 +17,14 @@ public class AuthService
|
||||
|
||||
public async Task<(bool Success, string Message)> LoginAsync(string rut, string password)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(rut) || string.IsNullOrWhiteSpace(password))
|
||||
return (false, "Ingrese usuario y contraseña");
|
||||
if (string.IsNullOrWhiteSpace(rut))
|
||||
return (false, "Ingrese su RUT");
|
||||
|
||||
var profesor = await _profesorRepo.BuscarPorRutAsync(rut);
|
||||
if (profesor == null)
|
||||
return (false, "Usuario no encontrado");
|
||||
|
||||
if (profesor.CrearClave)
|
||||
return (false, "Debe crear su contraseña primero");
|
||||
|
||||
var authenticated = await _profesorRepo.AutenticarAsync(rut, password);
|
||||
if (authenticated == null)
|
||||
return (false, "Contraseña incorrecta");
|
||||
|
||||
_currentUser = authenticated;
|
||||
_currentUser = profesor;
|
||||
return (true, "Inicio de sesión exitoso");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user