Implemented Profile Migration Backend

This commit is contained in:
rainbow napkin 2025-10-16 05:25:08 -04:00
parent da9428205f
commit 6cbb726764
8 changed files with 228 additions and 17 deletions

View file

@ -737,6 +737,24 @@ class canopyAjaxUtils{
}
}
async migrate(user, oldPass, newPass, passConfirm, verification){
var response = await fetch(`/api/account/migrate`,{
method: "POST",
headers: {
"Content-Type": "application/json",
//It's either this or find and bind all event listeners :P
"x-csrf-token": utils.ajax.getCSRFToken()
},
body: JSON.stringify({user, oldPass, newPass, passConfirm, verification})
});
if(response.ok){
location = "/";
}else{
utils.ux.displayResponseError(await response.json());
}
}
async login(user, pass, verification){
var response = await fetch(`/api/account/login`,{
method: "POST",