Fix: wg-easy threshold not properly computed (#3574)

This commit is contained in:
Conner Hnatiuk 2024-06-03 15:52:58 -06:00 committed by GitHub
parent 19c3ac0d7e
commit 67a69a5878
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -21,14 +21,21 @@ async function login(widget, service) {
});
try {
const connectSidCookie = responseHeaders["set-cookie"]
const connectSidCookie = responseHeaders["set-cookie"];
if (!connectSidCookie) {
const sid = cache.get(`${sessionSIDCacheKey}.${service}`);
if (sid) {
return sid;
}
}
connectSidCookie = connectSidCookie
.find((cookie) => cookie.startsWith("connect.sid="))
.split(";")[0]
.replace("connect.sid=", "");
cache.put(`${sessionSIDCacheKey}.${service}`, connectSidCookie);
return connectSidCookie;
} catch (e) {
logger.error(`Error logging into wg-easy`);
logger.error(`Error logging into wg-easy, error: ${e}`);
cache.del(`${sessionSIDCacheKey}.${service}`);
return null;
}