cookie issue checking

This commit is contained in:
unknown 2026-01-22 11:07:13 +05:30
parent 8e30b9fe54
commit a7b0e874f1

View File

@ -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",
});