From 8e30b9fe54a066f6500bbc02fe36a11f2672976c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Jan 2026 11:04:12 +0530 Subject: [PATCH] cookie issue checking --- app/controllers/auth.controller.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/auth.controller.js b/app/controllers/auth.controller.js index 2148641..4ebbe7b 100644 --- a/app/controllers/auth.controller.js +++ b/app/controllers/auth.controller.js @@ -107,6 +107,7 @@ exports.login = async (req, res) => { //logout exports.logout = (req, res) => { + try{ res.clearCookie("auth_token", { httpOnly: true, secure: process.env.NODE_ENV === "production", @@ -117,6 +118,15 @@ exports.logout = (req, res) => { status: "success", message: "Logged out successfully", }); + + } catch (err) { + logger.error(err.message); + logger.error(`Stack trace: ${err.stack}`); + return res.status(500).json({ + status: "failed", + message: "Internal server error", + }); + } }; const sanitizeStringValue = (value) =>