From a7b0e874f10e44a8f4d295ca3c6283a4fc2b5981 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Jan 2026 11:07:13 +0530 Subject: [PATCH] cookie issue checking --- app/controllers/auth.controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/auth.controller.js b/app/controllers/auth.controller.js index 4ebbe7b..72b6fdb 100644 --- a/app/controllers/auth.controller.js +++ b/app/controllers/auth.controller.js @@ -108,9 +108,10 @@ exports.login = async (req, res) => { //logout exports.logout = (req, res) => { try{ + const isProd = process.env.NODE_ENV === "production"; res.clearCookie("auth_token", { httpOnly: true, - secure: process.env.NODE_ENV === "production", + secure: isProd, sameSite: isProd ? "none" : "lax", });