diff --git a/src/commands/configure.gateway-auth.ts b/src/commands/configure.gateway-auth.ts index 537c0053904..54b24307dd2 100644 --- a/src/commands/configure.gateway-auth.ts +++ b/src/commands/configure.gateway-auth.ts @@ -124,7 +124,10 @@ function resolveConfiguredProviderFromAuthChange(params: { return changedProviders[0]; } - return configuredProviders.length === 1 ? configuredProviders[0] : params.preferredProvider; + return ( + params.preferredProvider ?? + (configuredProviders.length === 1 ? configuredProviders[0] : undefined) + ); } export function buildGatewayAuthConfig(params: {