add an unauthorized page

This commit is contained in:
Mystikfluu
2022-11-30 22:44:31 +01:00
parent 77ae066e46
commit 3a15b47fb1
11 changed files with 80 additions and 18 deletions
+4 -4
View File
@@ -13,10 +13,10 @@ async function register() {
}
let r = (await post("/register",{
user: document.getElementById("user").value,
pass: document.getElementById("pass").value
pass: document.getElementById("pass").value,
r: REDIRECT_URL
}))
console.log(r)
if(!r.url.endsWith("/user?success=true")) {
if(!r.url.endsWith("/user?success=true") && !r.url.endsWith(REDIRECT_URL)) {
if(r.url.endsWith("already_exists")) {
alert("An account with that name already exists! Did you mean to login?")
return
@@ -27,7 +27,7 @@ async function register() {
alert("Registration failed")
return;
}
window.location = "/user"
window.location = r.url
}
function passkeydown(e) {