From 8e0dc4bb88b9396fe61c54f7972b6bd393b7cecb Mon Sep 17 00:00:00 2001 From: Fachba Date: Fri, 9 Jan 2026 11:06:05 +0700 Subject: [PATCH] fixing token redirect --- controllers/auth.controller.js | 2 ++ services/notifikasi-wa.service.js | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/auth.controller.js b/controllers/auth.controller.js index 69ce205..4145227 100644 --- a/controllers/auth.controller.js +++ b/controllers/auth.controller.js @@ -104,6 +104,8 @@ class AuthController { const bytes = CryptoJS.AES.decrypt(tokenRedirect, process.env.VITE_KEY_SESSION); const decrypted = JSON.parse(bytes.toString(CryptoJS.enc.Utf8)); + console.log("decrypted: ", decrypted); + const userPhone = decrypted?.user_phone const userName = decrypted?.user_name const idData = decrypted?.id diff --git a/services/notifikasi-wa.service.js b/services/notifikasi-wa.service.js index f7d3a51..c726c22 100644 --- a/services/notifikasi-wa.service.js +++ b/services/notifikasi-wa.service.js @@ -67,8 +67,8 @@ class NotifikasiWaService { for (const dataUser of dataUsers) { if (dataUser.is_active) { const tokenRedirect = await generateTokenRedirect( - dataUser.userPhone, - dataUser.userName, + dataUser.contact_phone, + dataUser.contact_name, resultNotificationError.notification_error_id ); @@ -105,6 +105,8 @@ class NotifikasiWaService { param.bodyMessage ); + console.log("resultSend: ", resultSend); + await updateNotificationErrorUserDb( resultNotificationErrorUser[0].notification_error_user_id, {