incognito mode switch

This commit is contained in:
Archeb
2024-07-29 21:30:36 +08:00
parent 2a0b9f6e59
commit 4531b238f0
3 changed files with 13 additions and 7 deletions
+8 -5
View File
@@ -34,7 +34,7 @@ function extractCookie(cookies) {
}
function getSessionCookie(jwtSession, jwtToken) {
return [
var sessionCookie = [
{
name: "stytch_session",
value: jwtSession,
@@ -74,16 +74,19 @@ function getSessionCookie(jwtSession, jwtToken) {
httpOnly: true,
secure: true,
sameSite: "Lax",
},
{
}
];
if(process.env.INCOGNITO_MODE === "true") {
sessionCookie.push({
name: "incognito",
value: "true",
domain: "you.com",
path: "/",
expires: 1800000000,
secure: true,
}
];
});
}
return sessionCookie;
}
function sleep(ms) {