summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-06-27 16:09:38 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-06-27 16:09:38 +1000
commitb61cf4bdcdd3be62392b689d8a2b47f3250acc67 (patch)
tree48ae24989d1b70a429aa0f225be78c39f21c8e34
parentToken in localStorage must be JSON (diff)
downloadserver-b61cf4bdcdd3be62392b689d8a2b47f3250acc67.tar.xz
the cookie name is being a bitch?
-rw-r--r--slowcord/public/login.html4
-rw-r--r--slowcord/src/index.ts2
2 files changed, 3 insertions, 3 deletions
diff --git a/slowcord/public/login.html b/slowcord/public/login.html
index def2c786..ba49ecf8 100644
--- a/slowcord/public/login.html
+++ b/slowcord/public/login.html
@@ -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";
 		}
diff --git a/slowcord/src/index.ts b/slowcord/src/index.ts
index afa21e6a..e32651fb 100644
--- a/slowcord/src/index.ts
+++ b/slowcord/src/index.ts
@@ -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"));
 });