diff --git a/.changeset/dull-boats-look.md b/.changeset/dull-boats-look.md new file mode 100644 index 00000000..1606f158 --- /dev/null +++ b/.changeset/dull-boats-look.md @@ -0,0 +1,5 @@ +--- +"@openauthjs/openauth": patch +--- + +if only single provider is configured, skip provider selection diff --git a/packages/openauth/src/authorizer.ts b/packages/openauth/src/authorizer.ts index 56f18ba1..a049c052 100644 --- a/packages/openauth/src/authorizer.ts +++ b/packages/openauth/src/authorizer.ts @@ -583,6 +583,8 @@ export function authorizer< throw new UnauthorizedClientError(client_id, redirect_uri) await auth.set(c, "authorization", 60 * 60 * 24, authorization) if (provider) return c.redirect(`/${provider}/authorize`) + const providers = Object.keys(input.providers) + if (providers.length === 1) return c.redirect(`/${providers[0]}/authorize`) return auth.forward( c, await select(