pis #2

Merged
fred.boniface merged 76 commits from pis into main 2023-05-06 21:53:45 +01:00
4 changed files with 38 additions and 37 deletions
Showing only changes of commit ada28e034c - Show all commits

View File

@ -26,9 +26,9 @@
<!-- Main Content Begins --> <!-- Main Content Begins -->
<div id="top_button" class="hide_micro"> <div id="top_button" class="hide_micro">
<a href="./"> <a href="./">
<picture aria-label="Home" class="sidebar_control"> <picture id="home_icon">
<source srcset="./images/nav/back.svg" type="image/svg+xml"> <source srcset="./images/nav/home_icon.svg" type="image/svg+xml">
<img src="./images/nav/back-40.png" alt="Home"> <img src="./images/nav/home_icon-40.png" alt="Home">
</picture> </picture>
</a> </a>
</div> </div>

View File

@ -6,11 +6,12 @@ Auth process: User Requests Key => Server emails key to user =>
auth.js adds this to localStorage auth.js adds this to localStorage
*/ */
const cmd = document.getElementById("cmd") // Assign element to const const cmd = document.getElementById("cmd") // Assign element to const
versionDisplay(); // Show web version in footer
init(); // Run init function init(); // Run init function
async function sendHome(){ async function sendHome(){
await delay(2000); await delay(2000);
location.replace('/') location.replace('./')
} }
async function cmdOut(message) { async function cmdOut(message) {
@ -47,31 +48,32 @@ async function checkAuth(key) {
} }
async function init(){ // Reads registration key from query, and calls registerKey(key) async function init(){ // Reads registration key from query, and calls registerKey(key)
cmdOut("Reading authorisation code"); cmdOut("Reading authorisation code");
const key = await getQuery("key"); const key = await getQuery("key");
if (key === "false") { if (key === "false") {
cmdOut("No valid key found") cmdOut("No valid key found")
cmdOut("Try clicking the link again") cmdOut("Try clicking the link again or request a new activation link")
cmdOut("or request a new activation link") hideLoading()
hideLoading() return
return }
} cmdOut("Requesting API Key from server");
cmdOut("Requesting API Key from server"); if (!await registerKey(key)) {
if (!await registerKey(key)) { cmdOut("Failed to register or invalid key")
cmdOut("Failed to register key") cmdOut("Try again later or request a new link")
hideLoading() hideLoading()
return return
} }
showLoading() showLoading()
if (! await checkAuth(localStorage.getItem("uuid"))) { if (! await checkAuth(localStorage.getItem("uuid"))) {
cmdOut("Authentication Check failed") cmdOut("Authentication Check failed")
cmdOut("Please try again") cmdOut("Please logout and request a new link")
hideLoading() hideLoading()
await delay(2000) await delay(2000)
location.replace("./")
}
hideLoading();
cmdOut("Authentication succesful")
cmdOut("Redirecting to home")
await delay(3000)
location.replace("./") location.replace("./")
}
hideLoading();
cmdOut("Authentication succesful")
await delay(2000)
location.replace("./")
} }

View File

@ -76,13 +76,6 @@
height: 25px; height: 25px;
} }
#home_icon {
position: absolute;
width: 30px;
right: 10px;
top: 10px;
}
.header-small { .header-small {
text-align: right; text-align: right;
padding-right: 5px; padding-right: 5px;

View File

@ -106,6 +106,12 @@ body {
} }
body a {color:var(--link-color)} body a {color:var(--link-color)}
body a:visited {color:var(--link-visited-color)} body a:visited {color:var(--link-visited-color)}
#home_icon {
position: absolute;
width: 30px;
right: 10px;
top: 10px;
}
.titleimg { .titleimg {
width: 45%; width: 45%;
padding-top: 20px; padding-top: 20px;