web/admin: fix source selection for identification stage (#13007)

closes #12995

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L.
2025-02-13 13:30:04 +01:00
committed by GitHub
parent d18950f7bb
commit 1614f3174f
3 changed files with 9 additions and 4 deletions

View File

@ -27,13 +27,13 @@ export function sourcesSelector(instanceSources: string[] | undefined) {
return async () => {
const sourcesApi = new SourcesApi(DEFAULT_CONFIG);
const sources = await Promise.allSettled(
instanceSources.map((instanceId) =>
sourcesApi.sourcesAllRetrieve({ slug: instanceId }),
),
instanceSources.map((instanceId) => sourcesApi.sourcesAllList({ pbmUuid: instanceId })),
);
return sources
.filter((s) => s.status === "fulfilled")
.map((s) => s.value)
.filter((s) => s.pagination.count > 0)
.map((s) => s.results[0])
.map(sourceToSelect);
};
}