From 33e66635c3a896f5fca99d680294d3261646d2c6 Mon Sep 17 00:00:00 2001 From: BloxerHD018 Date: Tue, 4 Nov 2025 21:42:44 +0000 Subject: [PATCH] Fix Account Deletion --- account/index.html | 2 +- js/accounts.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/account/index.html b/account/index.html index 66c8a7d..8f68a81 100644 --- a/account/index.html +++ b/account/index.html @@ -55,7 +55,7 @@

Deleting your account is an irreversible action. You cannot recover your account once this has been done.

This will delete your account from our database, not from your Wii U or Cemu. You will need to manually remove it from these.

- +
diff --git a/js/accounts.js b/js/accounts.js index c02eb0d..79a7241 100644 --- a/js/accounts.js +++ b/js/accounts.js @@ -81,7 +81,21 @@ function hideDeleteWarning() { } async function deleteAccount() { - let token = await getToken(username, password); + let token; + + let expiryStr = sessionStorage.getItem("authExpires"); + if (expiryStr) { // Expiry exists so token should exist + let expiry = new Date(expiryStr); + if (expiry < new Date()) { // Expired token + 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) + window.location.href = "/account/login?redirect=/account" + } else { + token = sessionStorage.getItem("authToken"); + } + } else { // Token Never Saved in Session + window.location.href = "/account/login?redirect=/account" + } const response = await fetch("https://account.spfn.net/api/v2/users/@me/delete", { method: "GET",