forked from Ailur/burgernotes-server
Updated login.js
This commit is contained in:
parent
aa35c8f7b4
commit
3d252af12e
|
@ -127,6 +127,7 @@ signupButton.addEventListener("click", (event) => {
|
||||||
window.location.href = "/app"
|
window.location.href = "/app"
|
||||||
}
|
}
|
||||||
else if (response.status == 401) {
|
else if (response.status == 401) {
|
||||||
|
console.log("Trying oldhash")
|
||||||
fetch("/api/login", {
|
fetch("/api/login", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
@ -139,7 +140,7 @@ signupButton.addEventListener("click", (event) => {
|
||||||
})
|
})
|
||||||
.then((response) => response)
|
.then((response) => response)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
async function doStuff() {
|
async function doStuff2() {
|
||||||
let responseData = await response.json()
|
let responseData = await response.json()
|
||||||
if (response.status == 200) {
|
if (response.status == 200) {
|
||||||
localStorage.setItem("DONOTSHARE-secretkey", responseData["key"])
|
localStorage.setItem("DONOTSHARE-secretkey", responseData["key"])
|
||||||
|
@ -148,7 +149,6 @@ signupButton.addEventListener("click", (event) => {
|
||||||
window.location.href = "/app"
|
window.location.href = "/app"
|
||||||
}
|
}
|
||||||
else if (response.status == 401) {
|
else if (response.status == 401) {
|
||||||
|
|
||||||
statusBox.innerText = "Wrong username or password..."
|
statusBox.innerText = "Wrong username or password..."
|
||||||
showInput(1)
|
showInput(1)
|
||||||
showElements(true)
|
showElements(true)
|
||||||
|
@ -159,7 +159,7 @@ signupButton.addEventListener("click", (event) => {
|
||||||
showElements(true)
|
showElements(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doStuff()
|
doStuff2()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue