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