[PR #4919] [MERGED] feat: add support for custom callback for authorization url #13905

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4919
Author: @Bekacru
Created: 9/26/2025
Status: Merged
Merged: 9/26/2025
Merged by: @himself65

Base: canaryHead: feat/generic-oauth


📝 Commits (2)

  • 7ace7bb feat: add support for custom callback for authorization url
  • 54b6a58 add docs

📊 Changes

2 files changed (+20 additions, -6 deletions)

View changed files

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

📄 Description

closes #4453


Summary by cubic

Adds a callback option for authorizationUrlParams in the generic OAuth plugin, allowing per-request authorization URL params based on the current context. Works for both sign-in and link-account flows.

  • New Features
    • authorizationUrlParams now accepts a Record<string, string> or a (ctx: GenericEndpointContext) => Record<string, string>.
    • The callback receives GenericEndpointContext and its result is passed to createAuthorizationURL as additionalParams.
    • Backward compatible with existing static parameter configs.

🔄 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/4919 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 9/26/2025 **Status:** ✅ Merged **Merged:** 9/26/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/generic-oauth` --- ### 📝 Commits (2) - [`7ace7bb`](https://github.com/better-auth/better-auth/commit/7ace7bb55b715c023c07276631ecf0093ac8407e) feat: add support for custom callback for authorization url - [`54b6a58`](https://github.com/better-auth/better-auth/commit/54b6a58d99824ebe5f730f64b6856e48678f766e) add docs ### 📊 Changes **2 files changed** (+20 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/index.ts` (+19 -5) </details> ### 📄 Description closes #4453 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a callback option for authorizationUrlParams in the generic OAuth plugin, allowing per-request authorization URL params based on the current context. Works for both sign-in and link-account flows. - **New Features** - authorizationUrlParams now accepts a Record<string, string> or a (ctx: GenericEndpointContext) => Record<string, string>. - The callback receives GenericEndpointContext and its result is passed to createAuthorizationURL as additionalParams. - Backward compatible with existing static parameter configs. <!-- 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:16 -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#13905