Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions web/src/admin/providers/oauth2/OAuth2ProvidersProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { DualSelectPair } from "#elements/ak-dual-select/types";

import { OAuth2Provider, ProvidersApi } from "@goauthentik/api";

const providerToSelect = (provider: OAuth2Provider) => [provider.pk, provider.name];
const providerToSelect = (provider: OAuth2Provider) => [
provider.pk,
provider.name,
provider.name,
provider,
];

export async function oauth2ProvidersProvider(page = 1, search = "") {
const oauthProviders = await new ProvidersApi(DEFAULT_CONFIG).providersOauth2List({
Expand All @@ -22,10 +27,7 @@ export async function oauth2ProvidersProvider(page = 1, search = "") {

export function oauth2ProvidersSelector(instanceProviders: number[] | undefined) {
if (!instanceProviders) {
return async (mappings: DualSelectPair<OAuth2Provider>[]) =>
mappings.filter(
([_0, _1, _2, source]: DualSelectPair<OAuth2Provider>) => source !== undefined,
);
return async (mappings: DualSelectPair<OAuth2Provider>[]) => [];
}

return async () => {
Expand Down
5 changes: 1 addition & 4 deletions web/src/admin/providers/oauth2/OAuth2Sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ export async function oauth2SourcesProvider(page = 1, search = "") {

export function oauth2SourcesSelector(instanceMappings?: string[]) {
if (!instanceMappings) {
return async (mappings: DualSelectPair<OAuthSource>[]) =>
mappings.filter(
([_0, _1, _2, source]: DualSelectPair<OAuthSource>) => source !== undefined,
);
return async (mappings: DualSelectPair<OAuthSource>[]) => [];
}

return async () => {
Expand Down
Loading