summaryrefslogtreecommitdiff
path: root/web/share/js/index/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/share/js/index/main.js')
-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;