cookie issue checking
This commit is contained in:
parent
8e30b9fe54
commit
a7b0e874f1
@ -108,9 +108,10 @@ exports.login = async (req, res) => {
|
|||||||
//logout
|
//logout
|
||||||
exports.logout = (req, res) => {
|
exports.logout = (req, res) => {
|
||||||
try{
|
try{
|
||||||
|
const isProd = process.env.NODE_ENV === "production";
|
||||||
res.clearCookie("auth_token", {
|
res.clearCookie("auth_token", {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: process.env.NODE_ENV === "production",
|
secure: isProd,
|
||||||
sameSite: isProd ? "none" : "lax",
|
sameSite: isProd ? "none" : "lax",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user