From 41cd64144af208d59d5dea76e5d6bbd7d29fdb94 Mon Sep 17 00:00:00 2001 From: Tracker-Friendly Date: Tue, 2 Apr 2024 18:39:08 +0100 Subject: [PATCH] Redirect back if you aren't logged in --- static/js/dashboard.js | 6 ++++++ templates/main.html | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/static/js/dashboard.js b/static/js/dashboard.js index 399c32c..d7b4660 100644 --- a/static/js/dashboard.js +++ b/static/js/dashboard.js @@ -1,3 +1,9 @@ +if (localStorage.getItem("DONOTSHARE-secretkey") === null) { + window.location.replace("/login") + document.body.innerHTML = "Redirecting..." + throw new Error(); +} + function attempt() { if (document.getElementById("appidbox").value.match(/^[A-Za-z]+$/)) { fetch("https://auth.hectabit.org/api/newauth", { diff --git a/templates/main.html b/templates/main.html index 3760317..a7f06a0 100644 --- a/templates/main.html +++ b/templates/main.html @@ -9,6 +9,12 @@

Sending data...