fix(webui): revalidate authz for rename & delete account actions (#1860)
Reviewed-on: #1860 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
883426e429
commit
6f46ace40c
@ -78,19 +78,23 @@ function logout() {
|
||||
function renameAccount() {
|
||||
const newname = window.prompt(loc("code_changeNameConfirm"));
|
||||
if (newname) {
|
||||
revalidateAuthz(() => {
|
||||
fetch("/custom/renameAccount?" + window.authz + "&newname=" + newname).then(() => {
|
||||
$(".displayname").text(newname);
|
||||
updateLocElements();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteAccount() {
|
||||
if (window.confirm(loc("code_deleteAccountConfirm"))) {
|
||||
revalidateAuthz(() => {
|
||||
fetch("/custom/deleteAccount?" + window.authz).then(() => {
|
||||
logout();
|
||||
single.loadRoute("/webui/"); // Show login screen
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user