From 6c6179d2e73e62d1df22a09828b2b13574ed3b5d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 31 Dec 2025 17:32:22 +0530 Subject: [PATCH] Success message changed for OTP verification --- app/controllers/establishment.controller.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/establishment.controller.js b/app/controllers/establishment.controller.js index 95c980f..b8b91e7 100644 --- a/app/controllers/establishment.controller.js +++ b/app/controllers/establishment.controller.js @@ -1155,13 +1155,6 @@ exports.verifyOTPForLogin = async (req, res) => { }); } - if (!user.login_otp) { - return res.status(404).json({ - status: "failed", - message: "Verification code not found or invalid user" - }); - } - // Check OTP expiry if (new Date() > new Date(user.login_otp_expires_at)) { return res.status(400).json({ @@ -1170,6 +1163,13 @@ exports.verifyOTPForLogin = async (req, res) => { }); } + if (!user.login_otp) { + return res.status(404).json({ + status: "failed", + message: "Verification code not found or invalid user" + }); + } + // Verify OTP const isOtpValid = await bcrypt.compare(otp, user.login_otp); if (!isOtpValid) {