Implemented Profile Migration Backend
This commit is contained in:
parent
da9428205f
commit
6cbb726764
8 changed files with 228 additions and 17 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue