KEYCLOAK-5932: Remove social idp from dropdown if already defined
This commit is contained in:
parent
97e3b26a5c
commit
2b11938084
1 changed files with 17 additions and 1 deletions
|
@ -860,9 +860,11 @@ module.controller('RealmIdentityProviderCtrl', function($scope, $filter, $upload
|
||||||
$scope.serverInfo = serverInfo;
|
$scope.serverInfo = serverInfo;
|
||||||
|
|
||||||
$scope.allProviders = angular.copy(serverInfo.identityProviders);
|
$scope.allProviders = angular.copy(serverInfo.identityProviders);
|
||||||
|
|
||||||
$scope.configuredProviders = angular.copy(realm.identityProviders);
|
$scope.configuredProviders = angular.copy(realm.identityProviders);
|
||||||
|
|
||||||
|
removeUsedSocial();
|
||||||
|
|
||||||
$scope.authFlows = [];
|
$scope.authFlows = [];
|
||||||
for (var i=0 ; i<authFlows.length ; i++) {
|
for (var i=0 ; i<authFlows.length ; i++) {
|
||||||
if (authFlows[i].providerId == 'basic-flow') {
|
if (authFlows[i].providerId == 'basic-flow') {
|
||||||
|
@ -1045,6 +1047,20 @@ module.controller('RealmIdentityProviderCtrl', function($scope, $filter, $upload
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// KEYCLOAK-5932: remove social providers that have already been defined
|
||||||
|
function removeUsedSocial() {
|
||||||
|
var i = $scope.allProviders.length;
|
||||||
|
while (i--) {
|
||||||
|
if ($scope.allProviders[i].groupName !== 'Social') continue;
|
||||||
|
for (var j = 0; j < $scope.configuredProviders.length; j++) {
|
||||||
|
if ($scope.configuredProviders[j].providerId === $scope.allProviders[i].id) {
|
||||||
|
$scope.allProviders.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue