logout checking
This commit is contained in:
parent
d56089f6fc
commit
17d961db62
@ -109,18 +109,12 @@ 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: true,
|
secure: isProd,
|
||||||
sameSite: "none",
|
sameSite: isProd ? "none" : "lax",
|
||||||
path: "/",
|
path: "/",
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
status: "success",
|
status: "success",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user