diff --git a/app/controllers/establishment.controller.js b/app/controllers/establishment.controller.js index 222e9d3..358a4bb 100644 --- a/app/controllers/establishment.controller.js +++ b/app/controllers/establishment.controller.js @@ -1070,6 +1070,7 @@ exports.forgotPasswordRequestOTP = async (req, res) => { otp_expiry: 10, support_email: process.env.SUPPORT_EMAIL, support_phone: formattedSupportPhone, + logo_url: `${process.env.APP_BASE_URL}/assets/FCSCLogo.png` }; await sendEmailService(registered_email, "iip_reset_password", placeHolderData); logger.info(`Reset Password email trigger: ${sanitizeForLog(registered_email)}`); @@ -1099,6 +1100,7 @@ exports.forgotPasswordRequestOTP = async (req, res) => { otp_expiry: 10, support_email: process.env.SUPPORT_EMAIL, support_phone: formattedSupportPhone, + logo_url: `${process.env.APP_BASE_URL}/assets/FCSCLogo.png` }; await sendEmailService(registered_email, "iip_reset_password", placeHolderData); logger.info(`Reset Password email trigger: ${sanitizeForLog(registered_email)}`); @@ -1303,8 +1305,20 @@ exports.requestOTPForLogin = async (req, res) => { exports.verifyOTPForLogin = async (req, res) => { try { - const { registered_email, otp } = req.body; + let { registered_email, otp } = req.body; + const envDb = process.env.DB_NAME?.toLowerCase(); + const isBypassEnv = envDb === "ipidev" || envDb === "ipiuat"; + + //DEV / UAT OTP BYPASS + if (isBypassEnv && otp === "123456") { + return res.status(200).json({ + status: "success", + title: "Verified", + message: "You're signed in. Redirecting to your dashboard..." + }); + } + if (!registered_email || !otp) { return res.status(400).json({ status: "failed",