From eeec451cc67d266ede862916a51024db48bf7532 Mon Sep 17 00:00:00 2001 From: Scott Bader <58278360+ManWithACap@users.noreply.github.com> Date: Sat, 1 Jun 2024 05:31:05 +0000 Subject: [PATCH] redirection fix --- pages/scripts/dashboard.js | 2 +- scripts.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/scripts/dashboard.js b/pages/scripts/dashboard.js index 0867188..a1b14df 100644 --- a/pages/scripts/dashboard.js +++ b/pages/scripts/dashboard.js @@ -1,5 +1,5 @@ if (!sessionStorage.getItem("username")) { - window.location.href = "../../"; + window.location.href = localStorage.getItem("loginPage"); } window.onload = function() { diff --git a/scripts.js b/scripts.js index 2f0c294..0b1a6ee 100644 --- a/scripts.js +++ b/scripts.js @@ -1,5 +1,7 @@ const dashboardURL = "pages/dashboard.html"; +window.localStorage.setItem("loginPage", window.location.href); + document.getElementById('loginForm').addEventListener('submit', async function(event) { event.preventDefault();