[PR #4925] [CLOSED] feat: support for custom callback authorization params as function #13911

Closed
opened 2026-04-13 09:12:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4925
Author: @dvanmali
Created: 9/26/2025
Status: Closed

Base: canaryHead: additionalParams


📝 Commits (1)

  • 536f34e fix: support for custom callback authorization params as function

📊 Changes

3 files changed (+64 additions, -6 deletions)

View changed files

📝 docs/content/docs/plugins/generic-oauth.mdx (+1 -1)
📝 packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts (+44 -0)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+19 -5)

📄 Description

Adds custom callback authorization params as function and their respective tests.

Closes: #4453
Replace: #4919


Summary by cubic

Adds support for dynamic authorization URL params in Generic OAuth by allowing authorizationUrlParams to be a function. This lets apps compute per-request parameters using the endpoint context.

  • New Features
    • authorizationUrlParams now accepts a Record or a function (ctx) => Record for both sign-in and callback flows.
    • Updated docs and added tests covering record and function usage.

🔄 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/4925 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 9/26/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `additionalParams` --- ### 📝 Commits (1) - [`536f34e`](https://github.com/better-auth/better-auth/commit/536f34eb1c66c4a35270d37db701da213b44fd17) fix: support for custom callback authorization params as function ### 📊 Changes **3 files changed** (+64 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/generic-oauth.mdx` (+1 -1) 📝 `packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts` (+44 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+19 -5) </details> ### 📄 Description Adds custom callback authorization params as function and their respective tests. Closes: #4453 Replace: #4919 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds support for dynamic authorization URL params in Generic OAuth by allowing authorizationUrlParams to be a function. This lets apps compute per-request parameters using the endpoint context. - **New Features** - authorizationUrlParams now accepts a Record or a function (ctx) => Record for both sign-in and callback flows. - Updated docs and added tests covering record and function usage. <!-- 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-13 09:12:38 -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#13911