summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-03-26 00:54:16 +0300
committerMaxim Devaev <[email protected]>2022-03-26 00:54:16 +0300
commit3a878baac812958fd27ca5d82ef4bb4463de4654 (patch)
tree20b91c821e03e9df108ac29a0b9bad632ac441c1 /web
parented23fef5121f8f71b47b3e6aefe409a7e36fd9a7 (diff)
hide logout botton when auth is disabled
Diffstat (limited to 'web')
-rw-r--r--web/share/js/index/main.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/share/js/index/main.js b/web/share/js/index/main.js
index f153e2fa..b34fa099 100644
--- a/web/share/js/index/main.js
+++ b/web/share/js/index/main.js
@@ -51,7 +51,7 @@ function __setAppText() {
}
function __loadKvmdInfo() {
- let http = tools.makeRequest("GET", "/api/info?fields=meta,extras", function() {
+ let http = tools.makeRequest("GET", "/api/info?fields=auth,meta,extras", function() {
if (http.readyState === 4) {
if (http.status === 200) {
let info = JSON.parse(http.responseText).result;
@@ -85,8 +85,10 @@ function __loadKvmdInfo() {
}
}
- $("apps").innerHTML += __makeApp("logout-button", "#", "share/svg/logout.svg", "Logout");
- tools.el.setOnClick($("logout-button"), __logout);
+ if (info.auth.enabled) {
+ $("apps").innerHTML += __makeApp("logout-button", "#", "share/svg/logout.svg", "Logout");
+ tools.el.setOnClick($("logout-button"), __logout);
+ }
if (info.meta !== null && info.meta.server && info.meta.server.host) {
$("kvmd-meta-server-host").innerHTML = info.meta.server.host;