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:
parent
feb0d6584d
commit
b61cf4bdcd
@ -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"));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user