bypass DEV UAT OTP test
This commit is contained in:
parent
8da74dad15
commit
2569eeeef8
@ -1070,6 +1070,7 @@ exports.forgotPasswordRequestOTP = async (req, res) => {
|
|||||||
otp_expiry: 10,
|
otp_expiry: 10,
|
||||||
support_email: process.env.SUPPORT_EMAIL,
|
support_email: process.env.SUPPORT_EMAIL,
|
||||||
support_phone: formattedSupportPhone,
|
support_phone: formattedSupportPhone,
|
||||||
|
logo_url: `${process.env.APP_BASE_URL}/assets/FCSCLogo.png`
|
||||||
};
|
};
|
||||||
await sendEmailService(registered_email, "iip_reset_password", placeHolderData);
|
await sendEmailService(registered_email, "iip_reset_password", placeHolderData);
|
||||||
logger.info(`Reset Password email trigger: ${sanitizeForLog(registered_email)}`);
|
logger.info(`Reset Password email trigger: ${sanitizeForLog(registered_email)}`);
|
||||||
@ -1099,6 +1100,7 @@ exports.forgotPasswordRequestOTP = async (req, res) => {
|
|||||||
otp_expiry: 10,
|
otp_expiry: 10,
|
||||||
support_email: process.env.SUPPORT_EMAIL,
|
support_email: process.env.SUPPORT_EMAIL,
|
||||||
support_phone: formattedSupportPhone,
|
support_phone: formattedSupportPhone,
|
||||||
|
logo_url: `${process.env.APP_BASE_URL}/assets/FCSCLogo.png`
|
||||||
};
|
};
|
||||||
await sendEmailService(registered_email, "iip_reset_password", placeHolderData);
|
await sendEmailService(registered_email, "iip_reset_password", placeHolderData);
|
||||||
logger.info(`Reset Password email trigger: ${sanitizeForLog(registered_email)}`);
|
logger.info(`Reset Password email trigger: ${sanitizeForLog(registered_email)}`);
|
||||||
@ -1303,8 +1305,20 @@ exports.requestOTPForLogin = async (req, res) => {
|
|||||||
|
|
||||||
exports.verifyOTPForLogin = async (req, res) => {
|
exports.verifyOTPForLogin = async (req, res) => {
|
||||||
try {
|
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) {
|
if (!registered_email || !otp) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
status: "failed",
|
status: "failed",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user