Fixed register bugs.
parent
d3da1a1637
commit
b5e9238659
|
@ -29,10 +29,10 @@ form.addEventListener("submit", async function (event) {
|
||||||
try {
|
try {
|
||||||
const isTaken = await getUname();
|
const isTaken = await getUname();
|
||||||
|
|
||||||
if (isTaken.status === 'fail') {
|
if (isTaken.status === "fail") {
|
||||||
document.querySelector("#errormessage").innerHTML = `${uname} is already taken.`
|
register()
|
||||||
} else {
|
} else {
|
||||||
loginChange()
|
document.querySelector("#errormessage").innerHTML = `${uname} is already taken.`
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
document.querySelector("#errormessage").innerHTML = 'An Error has Occurred. Try again later.'
|
document.querySelector("#errormessage").innerHTML = 'An Error has Occurred. Try again later.'
|
||||||
|
@ -55,6 +55,6 @@ async function register() {
|
||||||
body: ""
|
body: ""
|
||||||
});
|
});
|
||||||
document.querySelector("#errormessage").innerHTML = 'Registered!'
|
document.querySelector("#errormessage").innerHTML = 'Registered!'
|
||||||
//window.location.replace("/login.html")
|
window.location.replace("/login.html")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue