incognito mode switch
This commit is contained in:
+2
-2
@@ -421,13 +421,13 @@ class YouProvider {
|
|||||||
(event) => {
|
(event) => {
|
||||||
window[callbackName]("done", "");
|
window[callbackName]("done", "");
|
||||||
evtSource.close();
|
evtSource.close();
|
||||||
/*fetch("https://you.com/api/chat/deleteChat", {//因为已经开启隐身模式了,所以就没必要删除了
|
fetch("https://you.com/api/chat/deleteChat", {
|
||||||
headers: {
|
headers: {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ chatId: traceId }),
|
body: JSON.stringify({ chatId: traceId }),
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
});*/
|
});
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ set AI_MODEL=
|
|||||||
REM 自定义会话模式
|
REM 自定义会话模式
|
||||||
set USE_CUSTOM_MODE=false
|
set USE_CUSTOM_MODE=false
|
||||||
|
|
||||||
|
REM 是否启用隐身模式
|
||||||
|
set INCOGNITO_MODE=false
|
||||||
|
|
||||||
REM 运行 Node.js 应用程序
|
REM 运行 Node.js 应用程序
|
||||||
node index.mjs
|
node index.mjs
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function extractCookie(cookies) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSessionCookie(jwtSession, jwtToken) {
|
function getSessionCookie(jwtSession, jwtToken) {
|
||||||
return [
|
var sessionCookie = [
|
||||||
{
|
{
|
||||||
name: "stytch_session",
|
name: "stytch_session",
|
||||||
value: jwtSession,
|
value: jwtSession,
|
||||||
@@ -74,16 +74,19 @@ function getSessionCookie(jwtSession, jwtToken) {
|
|||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: true,
|
secure: true,
|
||||||
sameSite: "Lax",
|
sameSite: "Lax",
|
||||||
},
|
}
|
||||||
{
|
];
|
||||||
|
if(process.env.INCOGNITO_MODE === "true") {
|
||||||
|
sessionCookie.push({
|
||||||
name: "incognito",
|
name: "incognito",
|
||||||
value: "true",
|
value: "true",
|
||||||
domain: "you.com",
|
domain: "you.com",
|
||||||
path: "/",
|
path: "/",
|
||||||
expires: 1800000000,
|
expires: 1800000000,
|
||||||
secure: true,
|
secure: true,
|
||||||
}
|
});
|
||||||
];
|
}
|
||||||
|
return sessionCookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sleep(ms) {
|
function sleep(ms) {
|
||||||
|
|||||||
Reference in New Issue
Block a user