[PR #5027] [MERGED] feat: add support for custom callback for token url #31326

Closed
opened 2026-04-17 22:12:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5027
Author: @acusti
Created: 10/1/2025
Status: Merged
Merged: 10/2/2025
Merged by: @Bekacru

Base: canaryHead: feat/generic-oauth


📝 Commits (2)

  • abb5648 feat: add support for custom callback for token url
  • a9bd9e4 add docs for tokenUrlParams option

📊 Changes

2 files changed (+10 additions, -2 deletions)

View changed files

📝 docs/content/docs/plugins/generic-oauth.mdx (+2 -0)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+8 -2)

📄 Description

closes #5026


Summary by cubic

Adds support for a callback to set token URL query params in the Generic OAuth plugin. This enables dynamic, per-request params for better compatibility with different OAuth servers.

  • New Features
    • tokenUrlParams now accepts a function (ctx => Record<string, string>) in addition to a static object.
    • Docs updated to describe tokenUrlParams and its callback option.

🔄 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/5027 **Author:** [@acusti](https://github.com/acusti) **Created:** 10/1/2025 **Status:** ✅ Merged **Merged:** 10/2/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `feat/generic-oauth` --- ### 📝 Commits (2) - [`abb5648`](https://github.com/better-auth/better-auth/commit/abb5648e3aeffe84f3b3b7eca405dedc842b0212) feat: add support for custom callback for token url - [`a9bd9e4`](https://github.com/better-auth/better-auth/commit/a9bd9e4b17b1deaea48f36a159f37fe56964ea5d) add docs for tokenUrlParams option ### 📊 Changes **2 files changed** (+10 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/generic-oauth.mdx` (+2 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+8 -2) </details> ### 📄 Description closes #5026 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds support for a callback to set token URL query params in the Generic OAuth plugin. This enables dynamic, per-request params for better compatibility with different OAuth servers. - **New Features** - tokenUrlParams now accepts a function (ctx => Record<string, string>) in addition to a static object. - Docs updated to describe tokenUrlParams and its callback option. <!-- 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-17 22:12:26 -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#31326