Feat Varios 3

This commit is contained in:
2026-01-06 10:34:06 -03:00
parent 0fa77e4a98
commit 9fa21ebec3
65 changed files with 2897 additions and 373 deletions

View File

@@ -46,7 +46,7 @@ public class AuthService : IAuthService
// Si MFA está activo, no devolver token aún, pedir verificación
if (user.IsMfaEnabled)
{
return new AuthResult { Success = true, RequiresMfa = true };
return new AuthResult { Success = true, RequiresMfa = true, UserId = user.Id };
}
// Éxito: Reiniciar intentos y generar token
@@ -59,7 +59,8 @@ public class AuthService : IAuthService
{
Success = true,
Token = _tokenService.GenerateToken(user),
RequiresPasswordChange = user.MustChangePassword
RequiresPasswordChange = user.MustChangePassword,
UserId = user.Id
};
}
@@ -83,7 +84,7 @@ public class AuthService : IAuthService
};
await _userRepo.CreateAsync(user);
return new AuthResult { Success = true, Token = _tokenService.GenerateToken(user) };
return new AuthResult { Success = true, Token = _tokenService.GenerateToken(user), UserId = user.Id };
}
// Login mediante Google OAuth
@@ -117,9 +118,9 @@ public class AuthService : IAuthService
await _userRepo.UpdateAsync(user);
}
if (user.IsMfaEnabled) return new AuthResult { Success = true, RequiresMfa = true };
if (user.IsMfaEnabled) return new AuthResult { Success = true, RequiresMfa = true, UserId = user.Id };
return new AuthResult { Success = true, Token = _tokenService.GenerateToken(user) };
return new AuthResult { Success = true, Token = _tokenService.GenerateToken(user), UserId = user.Id };
}
catch (InvalidJwtException)
{