Commit 017eab8d by Torkel Ödegaard

Login: only enabled oauth options are now shown on login page

parent 7e26d7a4
......@@ -34,12 +34,7 @@ function (_, crypto) {
}
};
// This initializes a new hash on purpose, to avoid adding parameters to
// config.js without providing sane defaults
var settings = {};
_.each(defaults, function(value, key) {
settings[key] = typeof options[key] !== 'undefined' ? options[key] : defaults[key];
});
var settings = _.extend(options, defaults);
var parseBasicAuth = function(datasource) {
var passwordEnd = datasource.url.indexOf('@');
......
......@@ -16,6 +16,10 @@ function (angular, config) {
};
$scope.grafana.sidemenu = false;
$scope.googleAuthEnabled = config.googleAuthEnabled;
$scope.githubAuthEnabled = config.githubAuthEnabled;
$scope.loginMode = true;
$scope.submitBtnClass = 'btn-inverse';
$scope.submitBtnText = 'Log in';
......
......@@ -80,11 +80,11 @@
<div class="clearfix"></div>
<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>
with Google
</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>
with Github
</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment