From ce19f6c5c6ab10a980f6c7de969f9a43598c1bea Mon Sep 17 00:00:00 2001 From: Sibunnayak Date: Wed, 19 Feb 2025 10:18:18 +0530 Subject: [PATCH] auth fixed --- middlewares/auth.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/middlewares/auth.js b/middlewares/auth.js index 44be282..be587cf 100644 --- a/middlewares/auth.js +++ b/middlewares/auth.js @@ -27,12 +27,12 @@ export const isAuthenticatedUser = async (req, res, next) => { // console.log(frontdecoded); const fuser = await User.findById(frontdecoded.id); // console.log(fuser); - // if (!fuser) { - // return res.status(404).json({ - // success: false, - // message: "User not found", - // }); - // } + if (!fuser) { + return res.status(404).json({ + success: false, + message: "User not found", + }); + } req.user = fuser; next();