Auth validation

This commit is contained in:
KGrzeg 2021-10-18 02:41:25 +02:00
parent e244da0942
commit f5380927fd
2 changed files with 19 additions and 3 deletions

View file

@ -73,20 +73,21 @@ declare global {
elements.name!.innerText = data.name!;
elements.key!.innerText = key!;
} else {
console.log("not logged in")
elements.bar.logged!.style.display = "none"
elements.bar.loggedout!.style.display = ""
}
}
async function login() {
const key = prompt("Type in the #key")
let key = prompt("Type in the #key")
if (!key) {
alert("Login cancelled")
return
}
key = key.replace(/\#/g, '')
const response = await API.login(key)
if (response.error) {