Actually Fix Account Deletion

This commit is contained in:
BloxerHD 2025-11-04 22:04:09 +00:00
commit 109955f7f9

View file

@ -85,13 +85,13 @@ async function deleteAccount() {
let expiryStr = sessionStorage.getItem("authExpires"); let expiryStr = sessionStorage.getItem("authExpires");
if (expiryStr) { // Expiry exists so token should exist if (expiryStr) { // Expiry exists so token should exist
token = sessionStorage.getItem("authToken");
let expiry = new Date(expiryStr); let expiry = new Date(expiryStr);
if (expiry < new Date()) { // Expired token if (expiry < new Date()) { // Expired token
window.location.href = "/account/login?redirect=/account" window.location.href = "/account/login?redirect=/account"
} else if (!token) { // Expiry Saved but No Token (shouldn't be possible but it'll be caught if it happens) } else if (!token) { // Expiry Saved but No Token (shouldn't be possible but it'll be caught if it happens)
window.location.href = "/account/login?redirect=/account" window.location.href = "/account/login?redirect=/account"
} else {
token = sessionStorage.getItem("authToken");
} }
} else { // Token Never Saved in Session } else { // Token Never Saved in Session
window.location.href = "/account/login?redirect=/account" window.location.href = "/account/login?redirect=/account"