Hs code validation bug fixed
This commit is contained in:
commit
53e25a039f
@ -763,6 +763,13 @@ exports.forgotPasswordRequestOTP = async (req, res) => {
|
||||
reset_otp_expires_at: new Date(Date.now() + 10 * 60 * 1000), // valid for 10 mins
|
||||
});
|
||||
|
||||
// Send OTP email
|
||||
await sendEmail(
|
||||
registered_email,
|
||||
"Password Reset OTP",
|
||||
`<p>Dear ${user.name},</p><p>Your OTP for password reset is <b>${otp}</b>. It is valid for 10 minutes.</p>`
|
||||
);
|
||||
|
||||
}else{
|
||||
|
||||
const adminUser = await user.findOne({where: { email: registered_email },});
|
||||
@ -782,19 +789,20 @@ exports.forgotPasswordRequestOTP = async (req, res) => {
|
||||
reset_otp_expires_at: new Date(Date.now() + 10 * 60 * 1000), // valid for 10 mins
|
||||
});
|
||||
|
||||
// Send OTP email
|
||||
await sendEmail(
|
||||
registered_email,
|
||||
"Password Reset OTP",
|
||||
`<p>Dear ${adminUser.name},</p><p>Your OTP for password reset is <b>${otp}</b>. It is valid for 10 minutes.</p>`
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Send OTP email
|
||||
await sendEmail(
|
||||
registered_email,
|
||||
"Password Reset OTP",
|
||||
`<p>Dear ${user.name},</p><p>Your OTP for password reset is <b>${otp}</b>. It is valid for 10 minutes.</p>`
|
||||
);
|
||||
|
||||
logger.info(`OTP sent to ${registered_email} for establishment_id=${establishment.id}`);
|
||||
logger.info(`OTP sent to ${registered_email}`);
|
||||
|
||||
return res.status(200).json({
|
||||
status: "success",
|
||||
@ -868,8 +876,6 @@ exports.forgotPasswordVerifyOTP = async (req, res) => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
logger.info(`Password reset successful for user=${registered_email}`);
|
||||
|
||||
return res.status(200).json({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user