返回提交历史
Modified
static/webui/script.js
+5
-2
XFEstudio/SpaceNinjaServer
fix(webui): don't resync permissions when logged out (#4009)
Closes #4006 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4009 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
162e013f
代码差异
1 个文件
+5
-2
@@ -63,8 +63,10 @@ function openWebSocket() {
63
63
}
64
64
if ("config_reloaded" in msg) {
65
65
refreshServerConfig();
66
// Our permissions may have changed, so resync them with the server.
67
ws.send(JSON.stringify({ allPermissions }));
66
if (window.authz) {
67
// Our permissions may have changed, so resync them with the server.
68
ws.send(JSON.stringify({ allPermissions }));
69
}
68
70
}
69
71
if ("auth_succ" in msg) {
70
72
auth_pending = false;
@@ -241,6 +243,7 @@ function revalidateAuthz() {
241
243
function logout() {
242
244
localStorage.removeItem("email");
243
245
localStorage.removeItem("password");
246
window.authz = undefined;
244
247
invalidateCachedData();
245
248
}
246
249