@@ -73,7 +73,14 @@ async function getAuthKeyAndCookie() {
|
|||||||
if (!sessionData.clientAuthKey) {
|
if (!sessionData.clientAuthKey) {
|
||||||
throw new Error("Session bootstrap failed: " + sessionText);
|
throw new Error("Session bootstrap failed: " + sessionText);
|
||||||
}
|
}
|
||||||
const setCookie = sessionRes.headers.get('set-cookie');
|
let setCookie = null;
|
||||||
|
if (sessionRes.headers) {
|
||||||
|
if (typeof sessionRes.headers.get === 'function') {
|
||||||
|
setCookie = sessionRes.headers.get('set-cookie');
|
||||||
|
} else {
|
||||||
|
setCookie = sessionRes.headers['set-cookie'] || sessionRes.headers['Set-Cookie'];
|
||||||
|
}
|
||||||
|
}
|
||||||
cachedAuthKey = sessionData.clientAuthKey;
|
cachedAuthKey = sessionData.clientAuthKey;
|
||||||
cachedAuthExpires = sessionData.expiresAt - 10;
|
cachedAuthExpires = sessionData.expiresAt - 10;
|
||||||
cachedCookie = setCookie ? setCookie.split(';')[0] : null;
|
cachedCookie = setCookie ? setCookie.split(';')[0] : null;
|
||||||
|
|||||||
Reference in New Issue
Block a user