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 -->
<div id="top_button" class="hide_micro">
<a href="./">
<picture aria-label="Home" class="sidebar_control">
<source srcset="./images/nav/back.svg" type="image/svg+xml">
<img src="./images/nav/back-40.png" alt="Home">
<picture id="home_icon">
<source srcset="./images/nav/home_icon.svg" type="image/svg+xml">
<img src="./images/nav/home_icon-40.png" alt="Home">
</picture>
</a>
</div>

View File

@ -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("./")
}

View File

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

View File

@ -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;