adding invites

This commit is contained in:
MathMan05
2024-08-15 17:05:14 -05:00
parent 3e5435668e
commit 3af371e6ab
16 changed files with 670 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
import {checkInstance} from "./login.js";
import {checkInstance, adduser} from "./login.js";
if(document.getElementById("register")){
document.getElementById("register").addEventListener("submit", registertry);
}
@@ -63,8 +63,14 @@ async function registertry(e){
document.getElementById("wrong").textContent=e.errors[Object.keys(e.errors)[0]]._errors[0].message;
}
}else{
adduser({serverurls:JSON.parse(localStorage.getItem("instanceinfo")),email:email,token:e.token}).username=username;
localStorage.setItem("token",e.token);
window.location.href = '/channels/@me';
const redir=new URLSearchParams(window.location.search).get("goback");
if(redir){
window.location.href = redir;
}else{
window.location.href = '/channels/@me';
}
}
})
})