From 579afd0d3205548261334d476900721e19413561 Mon Sep 17 00:00:00 2001 From: Frank Kong Date: Fri, 14 Jun 2024 16:55:00 -0400 Subject: [PATCH] chore(auth-node): allow declarative signin resolvers to take precedence Signed-off-by: Frank Kong --- .changeset/neat-socks-cheer.md | 5 +++++ plugins/auth-node/src/oauth/createOAuthProviderFactory.ts | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/neat-socks-cheer.md diff --git a/.changeset/neat-socks-cheer.md b/.changeset/neat-socks-cheer.md new file mode 100644 index 0000000000..5e2879b0a3 --- /dev/null +++ b/.changeset/neat-socks-cheer.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-node': patch +--- + +allow declarative sign in resolvers declared in `signInResolverFactories` to take precedence over the statically defined sign in resolvers in `signInResolver` for the `createOAuthProviderFactory`. diff --git a/plugins/auth-node/src/oauth/createOAuthProviderFactory.ts b/plugins/auth-node/src/oauth/createOAuthProviderFactory.ts index a3387b7038..fccfcb94de 100644 --- a/plugins/auth-node/src/oauth/createOAuthProviderFactory.ts +++ b/plugins/auth-node/src/oauth/createOAuthProviderFactory.ts @@ -43,11 +43,10 @@ export function createOAuthProviderFactory(options: { return ctx => { return OAuthEnvironmentHandler.mapConfig(ctx.config, envConfig => { const signInResolver = - options.signInResolver ?? readDeclarativeSignInResolver({ config: envConfig, signInResolverFactories: options.signInResolverFactories ?? {}, - }); + }) ?? options.signInResolver; return createOAuthRouteHandlers({ authenticator: options.authenticator,