Fixing some issues with dynamically supporting multiple SSO providers
This commit is contained in:
@ -8,11 +8,12 @@ angular.module('lemur')
|
||||
controller: 'LoginController'
|
||||
});
|
||||
})
|
||||
.controller('LoginController', function ($rootScope, $scope, AuthenticationService, UserService) {
|
||||
.controller('LoginController', function ($rootScope, $scope, AuthenticationService, UserService, providers) {
|
||||
$scope.login = AuthenticationService.login;
|
||||
$scope.authenticate = AuthenticationService.authenticate;
|
||||
$scope.logout = AuthenticationService.logout;
|
||||
$scope.get_providers = AuthenticationService.get_providers;
|
||||
|
||||
$scope.providers = providers;
|
||||
|
||||
UserService.getCurrentUser().then(function (user) {
|
||||
$scope.currentUser = user;
|
||||
|
@ -3,8 +3,8 @@
|
||||
<div class="login">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<button class="btn btn-block btn-default" ng-repeat="(key, value) in get_providers()" ng-click="authenticate(key)">
|
||||
Login with {{key}}
|
||||
<button class="btn btn-block btn-default" ng-repeat="(key, value) in providers" ng-click="authenticate(value.name)">
|
||||
Login with {{ value.name }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -6,10 +6,6 @@ angular.module('lemur')
|
||||
.service('AuthenticationService', function ($location, $rootScope, AuthenticationApi, UserService, toaster, $auth) {
|
||||
var AuthenticationService = this;
|
||||
|
||||
AuthenticationService.get_providers = function () {
|
||||
return AuthenticationApi.one('providers').get();
|
||||
};
|
||||
|
||||
AuthenticationService.login = function (username, password) {
|
||||
AuthenticationApi.customPOST({'username': username, 'password': password}, 'login')
|
||||
.then(
|
||||
|
Reference in New Issue
Block a user