1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-20 17:51:35 +02:00

the cookie name is being a bitch?

This commit is contained in:
Madeline 2022-06-27 16:09:38 +10:00
parent feb0d6584d
commit b61cf4bdcd
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47
2 changed files with 3 additions and 3 deletions

View File

@ -124,9 +124,9 @@
document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')?.pop() || ''
);
let token = getCookieValue("oauth-discord");
let token = getCookieValue("token");
if (token.trim().length) {
document.cookie = "oauth-discord="; // don't care
document.cookie = "token="; // don't care
window.localStorage.setItem("token", `"${token}"`);
window.location.href = "/app";
}

View File

@ -104,7 +104,7 @@ app.get("/oauth/:type", async (req, res) => {
const token = await generateToken(user.id);
res.cookie("oauth-discord", token, { signed: true });
res.cookie("token", token, { signed: true });
res.sendFile(path.join(__dirname, "../public/login.html"));
});