summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-06-27 16:12:55 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-06-27 16:12:55 +1000
commit7f121f243c18e3ab827505e7ce7ebb2b3ee949e1 (patch)
tree2990e799f880c77150ccd8d8889b14b498d4ff2d
parentthe cookie name is being a bitch? (diff)
downloadserver-7f121f243c18e3ab827505e7ce7ebb2b3ee949e1.tar.xz
clearing cookies is weird?
-rw-r--r--slowcord/public/login.html5
1 files changed, 4 insertions, 1 deletions
diff --git a/slowcord/public/login.html b/slowcord/public/login.html
index ba49ecf8..2325f396 100644
--- a/slowcord/public/login.html
+++ b/slowcord/public/login.html
@@ -73,6 +73,7 @@
 			border: 1px solid grey;
 			color: var(--foreground-primary);
 			text-decoration: none;
+			cursor: pointer;
 		}
 
 		form a {
@@ -126,7 +127,9 @@
 
 		let token = getCookieValue("token");
 		if (token.trim().length) {
-			document.cookie = "token=";	// don't care
+			/* https://stackoverflow.com/a/27374365 */
+			// why is clearing cookies so weird? wtf
+			document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
 			window.localStorage.setItem("token", `"${token}"`);
 			window.location.href = "/app";
 		}