From 19cc510379bae6832334c567aed10ed0a436d526 Mon Sep 17 00:00:00 2001 From: Fabio-Ramirez Date: Thu, 14 May 2026 11:16:29 -0300 Subject: [PATCH] =?UTF-8?q?AM=20-=20Corregir=20proceso=20de=20cambio=20de?= =?UTF-8?q?=20contrase=C3=B1a=20desde=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auth/auth.controller.ts | 4 ++-- auth/routes/routes.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/auth.controller.ts b/auth/auth.controller.ts index 4f920311a6..b7ab8f00f4 100644 --- a/auth/auth.controller.ts +++ b/auth/auth.controller.ts @@ -256,7 +256,7 @@ export async function sendOtpAndNotify(username): Promise { // Se mantiene la validación para usuarios temporales con email if (usuario) { - if (usuario.tipo === 'temporal' && usuario.email) { + if (usuario.tipo === 'temporal' && usuario.authMethod === 'password' && usuario.email) { // Genera un código OTP de 6 dígitos const otpCode = crypto.randomInt(100000, 999999).toString(); @@ -284,10 +284,10 @@ export async function sendOtpAndNotify(username): Promise { attachments: null, }; await sendMail(options); + return usuario; } else { return null; } - return usuario; } else { // El usuario no existe o no es un usuario temporal con email throw { tipo: 'cuentaInexistenteAndes' }; diff --git a/auth/routes/routes.ts b/auth/routes/routes.ts index 169b2d5d84..e0c76b0210 100644 --- a/auth/routes/routes.ts +++ b/auth/routes/routes.ts @@ -269,9 +269,9 @@ router.post('/sendOTPCode', async (req, res, next) => { if (username) { const result = await sendOtpAndNotify(username); if (result) { - return res.json({ status: 'ok' }); + return res.json({ status: 'ok' });// Profesional de Andes } else { - return res.json({ status: 'redirectOneLogin' }); + return res.json({ status: 'redirectOneLogin' });// Profesional de OneLogin } } else { return next(403);