Auth validation
This commit is contained in:
parent
e244da0942
commit
f5380927fd
2 changed files with 19 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue