bypass DEV UAT OTP test

This commit is contained in:
unknown 2026-01-20 20:11:48 +05:30
parent 8da74dad15
commit 2569eeeef8

View File

@ -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",