mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-14 13:45:49 +00:00
the cookie name is being a bitch?
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user