XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

fix(webui): revalidate authz for rename & delete account actions (#1860)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1860 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

6f46ace4
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +10 -6
Modified static/webui/script.js +10 -6
@@ -78,18 +78,22 @@ function logout() {
78 78 function renameAccount() {
79 79 const newname = window.prompt(loc("code_changeNameConfirm"));
80 80 if (newname) {
81 fetch("/custom/renameAccount?" + window.authz + "&newname=" + newname).then(() => {
82 $(".displayname").text(newname);
83 updateLocElements();
81 revalidateAuthz(() => {
82 fetch("/custom/renameAccount?" + window.authz + "&newname=" + newname).then(() => {
83 $(".displayname").text(newname);
84 updateLocElements();
85 });
84 86 });
85 87 }
86 88 }
87 89
88 90 function deleteAccount() {
89 91 if (window.confirm(loc("code_deleteAccountConfirm"))) {
90 fetch("/custom/deleteAccount?" + window.authz).then(() => {
91 logout();
92 single.loadRoute("/webui/"); // Show login screen
92 revalidateAuthz(() => {
93 fetch("/custom/deleteAccount?" + window.authz).then(() => {
94 logout();
95 single.loadRoute("/webui/"); // Show login screen
96 });
93 97 });
94 98 }
95 99 }