diff options
author | Maxim Devaev <[email protected]> | 2022-03-26 00:54:16 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-03-26 00:54:16 +0300 |
commit | 3a878baac812958fd27ca5d82ef4bb4463de4654 (patch) | |
tree | 20b91c821e03e9df108ac29a0b9bad632ac441c1 /web | |
parent | ed23fef5121f8f71b47b3e6aefe409a7e36fd9a7 (diff) |
hide logout botton when auth is disabled
Diffstat (limited to 'web')
-rw-r--r-- | web/share/js/index/main.js | 8 |
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; |