[PR #5443] Add additionalParams support to signIn.social and Amazon Cognito options #22914

Open
opened 2026-04-15 21:21:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5443
Author: @krmrn42
Created: 10/21/2025
Status: 🔄 Open

Base: mainHead: feat/signin-additional-params


📝 Commits (1)

  • 14de6d3 feat: add additionalParams support to signIn.social and Amazon Cognito options

📊 Changes

4 files changed (+48 additions, -16 deletions)

View changed files

📝 docs/content/docs/authentication/cognito.mdx (+7 -6)
📝 packages/better-auth/src/api/routes/sign-in.ts (+16 -5)
📝 packages/core/src/oauth2/oauth-provider.ts (+1 -0)
📝 packages/core/src/social-providers/cognito.ts (+24 -5)

📄 Description

fixes #5441


Summary by cubic

Add support for additionalParams in signIn.social and the Cognito provider to pass extra query args to the OAuth authorization URL. This enables flows like pre-selecting an IdP via identity_provider.

  • New Features
    • signIn.social accepts additionalParams: Record<string, string>, forwarded to the authorization URL.
    • Core OAuthProvider.createAuthorizationURL now supports additionalParams.
    • Cognito provider supports additionalParams at both provider options and per-request; values are merged with per-request taking precedence.
    • Docs updated to show additionalParams usage for Cognito (e.g., identity_provider).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5443 **Author:** [@krmrn42](https://github.com/krmrn42) **Created:** 10/21/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/signin-additional-params` --- ### 📝 Commits (1) - [`14de6d3`](https://github.com/better-auth/better-auth/commit/14de6d3893d3b20fae72b13a772696274a44c44f) feat: add additionalParams support to signIn.social and Amazon Cognito options ### 📊 Changes **4 files changed** (+48 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/authentication/cognito.mdx` (+7 -6) 📝 `packages/better-auth/src/api/routes/sign-in.ts` (+16 -5) 📝 `packages/core/src/oauth2/oauth-provider.ts` (+1 -0) 📝 `packages/core/src/social-providers/cognito.ts` (+24 -5) </details> ### 📄 Description fixes #5441 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add support for additionalParams in signIn.social and the Cognito provider to pass extra query args to the OAuth authorization URL. This enables flows like pre-selecting an IdP via identity_provider. - **New Features** - signIn.social accepts additionalParams: Record<string, string>, forwarded to the authorization URL. - Core OAuthProvider.createAuthorizationURL now supports additionalParams. - Cognito provider supports additionalParams at both provider options and per-request; values are merged with per-request taking precedence. - Docs updated to show additionalParams usage for Cognito (e.g., identity_provider). <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 21:21:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#22914