Show elements as well when an error occurs in login.js

This commit is contained in:
Tracker-Friendly 2024-06-26 19:03:42 +01:00
parent 89884a690c
commit b1f854b70b
1 changed files with 3 additions and 0 deletions

View File

@ -174,6 +174,7 @@ signupButton.addEventListener("click", () => {
if (loginOld.status === 401) { if (loginOld.status === 401) {
statusBox.innerText = "Username or password incorrect!" statusBox.innerText = "Username or password incorrect!"
showInput(1) showInput(1)
showElements(true)
} else if (loginOld.status === 200) { } else if (loginOld.status === 200) {
localStorage.setItem("DONOTSHARE-secretkey", loginDataOld["key"]) localStorage.setItem("DONOTSHARE-secretkey", loginDataOld["key"])
localStorage.setItem("DONOTSHARE-password", await hashwasm.sha512(password)) localStorage.setItem("DONOTSHARE-password", await hashwasm.sha512(password))
@ -185,6 +186,7 @@ signupButton.addEventListener("click", () => {
} else { } else {
statusBox.innerText = loginDataOld["error"] statusBox.innerText = loginDataOld["error"]
showInput(1) showInput(1)
showElements(true)
} }
} else if (login.status === 200) { } else if (login.status === 200) {
localStorage.setItem("DONOTSHARE-secretkey", loginData["key"]) localStorage.setItem("DONOTSHARE-secretkey", loginData["key"])
@ -196,6 +198,7 @@ signupButton.addEventListener("click", () => {
} else { } else {
statusBox.innerText = loginData["error"] statusBox.innerText = loginData["error"]
showInput(1) showInput(1)
showElements(true)
} }
} }
doStuff() doStuff()