Fixed register bugs.

main
Luna 2021-07-22 08:10:35 -07:00
parent d3da1a1637
commit b5e9238659
1 changed files with 4 additions and 4 deletions

View File

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