Token in localStorage must be JSON

This commit is contained in:
Madeline
2022-06-27 16:04:17 +10:00
parent 290b2743e2
commit feb0d6584d

View File

@@ -127,7 +127,7 @@
let token = getCookieValue("oauth-discord");
if (token.trim().length) {
document.cookie = "oauth-discord="; // don't care
window.localStorage.setItem("token", token);
window.localStorage.setItem("token", `"${token}"`);
window.location.href = "/app";
}
@@ -152,7 +152,7 @@
const json = await response.json();
if (json.token) {
window.localStorage.setItem("token", json.token);
window.localStorage.setItem("token", `"${json.token}"`);
window.location.href = "/app";
}
})