CB-4173 configurable iam provider (#2126)

* CB-4174 configurable iam provider

* CB-4174 refactor: display only available auth providers

* CB-4174 refactor: display only available auth providers

* CB-4174 refactor: display only available auth providers

* CB-4174 chore: remove unused config properties

---------

Co-authored-by: Aleksei Potsetsuev <wrouds@gmail.com>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
This commit is contained in:
Alexander Skoblikov
2023-11-15 20:12:53 +03:00
committed by GitHub
co-authored by Aleksei Potsetsuev Evgenia Bezborodova
parent c6e8d27e31
commit dfd572aa4c
12 changed files with 43 additions and 73 deletions
@@ -53,15 +53,10 @@ export function useAuthDialogState(accessRequest: boolean, providerId: string |
const authInfoService = useService(AuthInfoService);
const notificationService = useService(NotificationService);
const primaryId = authProvidersResource.resource.getPrimary();
const adminPageActive = administrationScreenService.isAdministrationPageActive;
const providers = authProvidersResource.data.filter(notEmptyProvider).sort(compareProviders);
const activeProviders = providers.filter(provider => {
if (provider.id === primaryId && adminPageActive && accessRequest) {
return true;
}
if (provider.federated || provider.trusted || provider.private) {
return false;
}
@@ -170,9 +165,6 @@ export function useAuthDialogState(accessRequest: boolean, providerId: string |
get configure(): boolean {
if (state.activeProvider) {
if (this.adminPageActive && authProvidersResource.resource.isPrimary(state.activeProvider.id)) {
return false;
}
return !authProvidersResource.resource.isAuthEnabled(state.activeProvider.id);
}
return false;