mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 23:38:46 +00:00
Fix: wg-easy threshold not properly computed (#3574)
This commit is contained in:
parent
19c3ac0d7e
commit
67a69a5878
2 changed files with 10 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue