| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- commit 017eab8dcd182b8c19f65657fc3d46e30545b7ff
- Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
- Date: Wed Jan 28 10:25:53 2015 +0100
- Login: only enabled oauth options are now shown on login page
- diff --git a/src/app/components/settings.js b/src/app/components/settings.js
- index 9bef2757d..3be2292e1 100644
- --- a/src/app/components/settings.js
- +++ b/src/app/components/settings.js
- @@ -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('@');
- diff --git a/src/app/controllers/loginCtrl.js b/src/app/controllers/loginCtrl.js
- index c3696d551..e6b0f99f8 100644
- --- a/src/app/controllers/loginCtrl.js
- +++ b/src/app/controllers/loginCtrl.js
- @@ -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';
- diff --git a/src/app/partials/login.html b/src/app/partials/login.html
- index d96b4d1f9..e57cb2531 100644
- --- a/src/app/partials/login.html
- +++ b/src/app/partials/login.html
- @@ -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>
|