diff --git a/gui/default/index.html b/gui/default/index.html
index 0266da1a0..ea3dd0ebd 100644
--- a/gui/default/index.html
+++ b/gui/default/index.html
@@ -126,10 +126,12 @@
Advanced
Logs
- Log Out
Support Bundle
+
+
+ Log Out
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index 492e877c2..6b8180763 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -565,6 +565,15 @@ angular.module('syncthing.core')
}).error($scope.emitHTTPError);
}
+ $scope.isAuthEnabled = function () {
+ // This function should match IsAuthEnabled() in guiconfiguration.go
+ var guiCfg = $scope.config && $scope.config.gui;
+ if (guiCfg) {
+ return guiCfg.authMode === 'ldap' || (guiCfg.user && guiCfg.password);
+ }
+ return false;
+ };
+
function refreshNoAuthWarning() {
if (!$scope.system || !$scope.config || !$scope.config.gui) {
// We need all to be able to determine the state.
@@ -579,8 +588,7 @@ angular.module('syncthing.core')
$scope.openNoAuth = addr.substr(0, 4) !== "127."
&& addr.substr(0, 6) !== "[::1]:"
&& addr.substr(0, 1) !== "/"
- && (!guiCfg.user || !guiCfg.password)
- && guiCfg.authMode !== 'ldap'
+ && !$scope.isAuthEnabled()
&& !guiCfg.insecureAdminAccess;
if ((guiCfg.user && guiCfg.password) || guiCfg.authMode === 'ldap') {
diff --git a/lib/config/guiconfiguration.go b/lib/config/guiconfiguration.go
index 77832a349..538bcef92 100644
--- a/lib/config/guiconfiguration.go
+++ b/lib/config/guiconfiguration.go
@@ -19,6 +19,7 @@ import (
)
func (c GUIConfiguration) IsAuthEnabled() bool {
+ // This function should match isAuthEnabled() in syncthingController.js
return c.AuthMode == AuthModeLDAP || (len(c.User) > 0 && len(c.Password) > 0)
}