Login: only enabled oauth options are now shown on login page
This commit is contained in:
@@ -34,12 +34,7 @@ function (_, crypto) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// This initializes a new hash on purpose, to avoid adding parameters to
|
var settings = _.extend(options, defaults);
|
||||||
// config.js without providing sane defaults
|
|
||||||
var settings = {};
|
|
||||||
_.each(defaults, function(value, key) {
|
|
||||||
settings[key] = typeof options[key] !== 'undefined' ? options[key] : defaults[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
var parseBasicAuth = function(datasource) {
|
var parseBasicAuth = function(datasource) {
|
||||||
var passwordEnd = datasource.url.indexOf('@');
|
var passwordEnd = datasource.url.indexOf('@');
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ function (angular, config) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.grafana.sidemenu = false;
|
$scope.grafana.sidemenu = false;
|
||||||
|
|
||||||
|
$scope.googleAuthEnabled = config.googleAuthEnabled;
|
||||||
|
$scope.githubAuthEnabled = config.githubAuthEnabled;
|
||||||
|
|
||||||
$scope.loginMode = true;
|
$scope.loginMode = true;
|
||||||
$scope.submitBtnClass = 'btn-inverse';
|
$scope.submitBtnClass = 'btn-inverse';
|
||||||
$scope.submitBtnText = 'Log in';
|
$scope.submitBtnText = 'Log in';
|
||||||
|
|||||||
@@ -80,11 +80,11 @@
|
|||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
<div class="login-oauth text-center">
|
<div class="login-oauth text-center">
|
||||||
<a class="btn btn-google" href="login/google" target="_self">
|
<a class="btn btn-google" href="login/google" target="_self" ng-if="googleAuthEnabled">
|
||||||
<i class="fa fa-google"></i>
|
<i class="fa fa-google"></i>
|
||||||
with Google
|
with Google
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-github" href="login/github" target="_self">
|
<a class="btn btn-github" href="login/github" target="_self" ng-if="githubAuthEnabled">
|
||||||
<i class="fa fa-github"></i>
|
<i class="fa fa-github"></i>
|
||||||
with Github
|
with Github
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user