Redirect back if you aren't logged in

This commit is contained in:
Tracker-Friendly 2024-04-02 18:39:08 +01:00
parent 84a0cdcbf6
commit 41cd64144a
2 changed files with 12 additions and 0 deletions

View File

@ -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", {

View File

@ -9,6 +9,12 @@
<p>Sending data...</p>
<script>
if (localStorage.getItem("DONOTSHARE-secretkey") !== null) {
window.location.replace("/app" + window.location.search)
document.body.innerHTML = "Redirecting..."
throw new Error();
}
function oauth() {
const urlParams = new URLSearchParams(window.location.search);