Skip to content

Commit

Permalink
if only single provider is configured, skip provider selection
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Dec 12, 2024
1 parent f7e287d commit 04cd031
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-boats-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openauthjs/openauth": patch
---

if only single provider is configured, skip provider selection
2 changes: 2 additions & 0 deletions packages/openauth/src/authorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 04cd031

Please sign in to comment.