diff --git a/auth.html b/auth.html index a91528e..7572510 100644 --- a/auth.html +++ b/auth.html @@ -26,9 +26,9 @@
- - - Home + + + Home
diff --git a/js/auth.js b/js/auth.js index 8e8fc2f..5b25a09 100644 --- a/js/auth.js +++ b/js/auth.js @@ -6,11 +6,12 @@ Auth process: User Requests Key => Server emails key to user => auth.js adds this to localStorage */ const cmd = document.getElementById("cmd") // Assign element to const +versionDisplay(); // Show web version in footer init(); // Run init function async function sendHome(){ await delay(2000); - location.replace('/') + location.replace('./') } async function cmdOut(message) { @@ -47,31 +48,32 @@ async function checkAuth(key) { } async function init(){ // Reads registration key from query, and calls registerKey(key) - cmdOut("Reading authorisation code"); - const key = await getQuery("key"); - if (key === "false") { - cmdOut("No valid key found") - cmdOut("Try clicking the link again") - cmdOut("or request a new activation link") - hideLoading() - return - } - cmdOut("Requesting API Key from server"); - if (!await registerKey(key)) { - cmdOut("Failed to register key") - hideLoading() - return - } - showLoading() - if (! await checkAuth(localStorage.getItem("uuid"))) { - cmdOut("Authentication Check failed") - cmdOut("Please try again") - hideLoading() - await delay(2000) + cmdOut("Reading authorisation code"); + const key = await getQuery("key"); + if (key === "false") { + cmdOut("No valid key found") + cmdOut("Try clicking the link again or request a new activation link") + hideLoading() + return + } + cmdOut("Requesting API Key from server"); + if (!await registerKey(key)) { + cmdOut("Failed to register or invalid key") + cmdOut("Try again later or request a new link") + hideLoading() + return + } + showLoading() + if (! await checkAuth(localStorage.getItem("uuid"))) { + cmdOut("Authentication Check failed") + cmdOut("Please logout and request a new link") + hideLoading() + await delay(2000) + location.replace("./") + } + hideLoading(); + cmdOut("Authentication succesful") + cmdOut("Redirecting to home") + await delay(3000) location.replace("./") - } - hideLoading(); - cmdOut("Authentication succesful") - await delay(2000) - location.replace("./") } \ No newline at end of file diff --git a/styles/board.css b/styles/board.css index fe946bf..19dd40b 100644 --- a/styles/board.css +++ b/styles/board.css @@ -76,13 +76,6 @@ height: 25px; } -#home_icon { - position: absolute; - width: 30px; - right: 10px; - top: 10px; -} - .header-small { text-align: right; padding-right: 5px; diff --git a/styles/main.css b/styles/main.css index f38a7a2..e32ff31 100644 --- a/styles/main.css +++ b/styles/main.css @@ -106,6 +106,12 @@ body { } body a {color:var(--link-color)} body a:visited {color:var(--link-visited-color)} +#home_icon { + position: absolute; + width: 30px; + right: 10px; + top: 10px; +} .titleimg { width: 45%; padding-top: 20px;