[PR #7660] [CLOSED] feat(generic-oauth): add refreshTokenUrlParams to GenericOAuthConfig #33074

Closed
opened 2026-04-17 23:44:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7660
Author: @JoshWilkesQoria
Created: 1/28/2026
Status: Closed

Base: nextHead: feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin


📝 Commits (8)

  • d89d9ce feat(generic-oauth): add refreshAccessToken extra params to GenericOAuthConfig
  • 6414eb1 Update parameter name for consistency
  • c561644 refactor(generic-oauth): rename refreshTokenParams to refreshTokenUrlParams
  • 3033e14 Merge branch 'next' into feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin
  • 32572d5 Add missing type import
  • 3fe8134 Update implementation to match refactor
  • 662ebe8 remove whitespace
  • e59a2cf Add changeset

📊 Changes

5 files changed (+61 additions, -0 deletions)

View changed files

.changeset/refresh-token-url-params.md (+5 -0)
📝 docs/content/docs/plugins/generic-oauth.mdx (+3 -0)
📝 packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts (+48 -0)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+1 -0)
📝 packages/better-auth/src/plugins/generic-oauth/types.ts (+4 -0)

📄 Description

addresses https://github.com/better-auth/better-auth/issues/7554

This PR exposes the existing extraParams field for the refreshAccessToken function in the GenericOAuthConfig type, allowing additional data to be provided during the refresh token flow to support non standard OAuth server requirements.

Example usage:

genericOAuth({
      config: [
        {
          refreshAccessTokenExtraParams: {
            client_id: serverEnv.CLIENT_ID,
            redirect_uri: serverEnv.REDIRECT_URI,
          },
          // ...other config
        },
      ],
    }),

Summary by cubic

Adds refreshTokenUrlParams to GenericOAuthConfig to pass extra query params on refresh token requests. Aligns with tokenUrlParams; docs and tests updated.

Written for commit e59a2cfdd2. Summary will update on new commits.


🔄 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/7660 **Author:** [@JoshWilkesQoria](https://github.com/JoshWilkesQoria) **Created:** 1/28/2026 **Status:** ❌ Closed **Base:** `next` ← **Head:** `feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin` --- ### 📝 Commits (8) - [`d89d9ce`](https://github.com/better-auth/better-auth/commit/d89d9cea97126b1dc57d4e88d22b0d54ebb4185a) feat(generic-oauth): add refreshAccessToken extra params to GenericOAuthConfig - [`6414eb1`](https://github.com/better-auth/better-auth/commit/6414eb17991e213e475bcd2c2ccba9e08862ff3e) Update parameter name for consistency - [`c561644`](https://github.com/better-auth/better-auth/commit/c5616441483c6cd76e262d9a984a9cf0933ca135) refactor(generic-oauth): rename refreshTokenParams to refreshTokenUrlParams - [`3033e14`](https://github.com/better-auth/better-auth/commit/3033e14761ce079e5905cc54ce98d549fa3ae3ea) Merge branch 'next' into feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin - [`32572d5`](https://github.com/better-auth/better-auth/commit/32572d57ac3ed6c6b5f1c0c93aee44834055b33b) Add missing type import - [`3fe8134`](https://github.com/better-auth/better-auth/commit/3fe813438a6f67df9b8c2000fc481418dff1259b) Update implementation to match refactor - [`662ebe8`](https://github.com/better-auth/better-auth/commit/662ebe82e9fb46cbe99ff2e857c6bc9d99a7c701) remove whitespace - [`e59a2cf`](https://github.com/better-auth/better-auth/commit/e59a2cfdd2f5fe3c7f02f37d15d0da275a6b159f) Add changeset ### 📊 Changes **5 files changed** (+61 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/refresh-token-url-params.md` (+5 -0) 📝 `docs/content/docs/plugins/generic-oauth.mdx` (+3 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts` (+48 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+1 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/types.ts` (+4 -0) </details> ### 📄 Description addresses https://github.com/better-auth/better-auth/issues/7554 This PR exposes the existing `extraParams` field for the refreshAccessToken function in the GenericOAuthConfig type, allowing additional data to be provided during the refresh token flow to support non standard OAuth server requirements. Example usage: ```typescript genericOAuth({ config: [ { refreshAccessTokenExtraParams: { client_id: serverEnv.CLIENT_ID, redirect_uri: serverEnv.REDIRECT_URI, }, // ...other config }, ], }), ``` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds `refreshTokenUrlParams` to `GenericOAuthConfig` to pass extra query params on refresh token requests. Aligns with `tokenUrlParams`; docs and tests updated. <sup>Written for commit e59a2cfdd2f5fe3c7f02f37d15d0da275a6b159f. Summary will update on new commits.</sup> <!-- 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 23:44:40 -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#33074