Update src/widgets/wgeasy/proxy.js

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
pull/3476/head
Conner Hnatiuk 3 weeks ago committed by GitHub
parent 0dba883641
commit 1f62e11d88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -20,19 +20,18 @@ async function login(widget, service) {
},
});
let connectSidCookie;
try {
connectSidCookie = responseHeaders["set-cookie"]
const connectSidCookie = responseHeaders["set-cookie"]
.find((cookie) => cookie.startsWith("connect.sid="))
.split(";")[0]
.replace("connect.sid=", "");
cache.put(`${sessionSIDCacheKey}.${service}`);
return connectSidCookie;
} catch (e) {
logger.error(`Error logging into wg-easy`);
cache.del(`${sessionSIDCacheKey}.${service}`);
return null;
}
return [status, connectSidCookie ?? null];
}
export default async function wgeasyProxyHandler(req, res) {

Loading…
Cancel
Save