Show elements as well when an error occurs in login.js
This commit is contained in:
parent
89884a690c
commit
b1f854b70b
|
@ -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()
|
||||||
|
|
Reference in New Issue