mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-08-29 18:31:33 +00:00
fix: general bug fixes
This commit is contained in:
+14
-7
@@ -1593,16 +1593,23 @@ function getC2SRelayUrl() {
|
||||
}
|
||||
|
||||
async function getC2SRelayHeaders(relayUrl) {
|
||||
if (!mainWindow?.webContents?.session) return {};
|
||||
|
||||
const cookieUrl = relayUrl
|
||||
.replace(/^ws:/, "http:")
|
||||
.replace(/^wss:/, "https:");
|
||||
const cookies = await mainWindow.webContents.session.cookies.get({
|
||||
url: cookieUrl,
|
||||
name: "jwt",
|
||||
});
|
||||
const jwt = cookies[0]?.value;
|
||||
|
||||
let jwt;
|
||||
if (mainWindow?.webContents?.session) {
|
||||
const cookies = await mainWindow.webContents.session.cookies.get({
|
||||
url: cookieUrl,
|
||||
name: "jwt",
|
||||
});
|
||||
jwt = cookies[0]?.value;
|
||||
}
|
||||
|
||||
if (!jwt) {
|
||||
jwt = getRememberedElectronAuthCookie("jwt", cookieUrl)?.value;
|
||||
}
|
||||
|
||||
if (!jwt) return {};
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user