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

Open
opened 2026-03-13 13:37:53 -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: 🔄 Open

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


📝 Commits (6)

  • 12ab63f feat(generic-oauth): add refreshAccessToken extra params to GenericOAuthConfig
  • 63a32cc Update parameter name for consistency
  • d1170a1 Merge branch 'better-auth:canary' into feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin
  • 442d64e refactor(generic-oauth): rename refreshTokenParams to refreshTokenUrlParams
  • 5a07cf3 Merge branch 'canary' into feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin
  • 6b3ac82 Merge branch 'canary' into feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin

📊 Changes

4 files changed (+142 additions, -1 deletions)

View changed files

📝 docs/content/docs/plugins/generic-oauth.mdx (+5 -0)
📝 packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts (+103 -0)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+24 -1)
📝 packages/better-auth/src/plugins/generic-oauth/types.ts (+10 -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 and forwards it to refreshAccessToken, allowing extra params in refresh token requests. Supports a static object or a function that receives GenericEndpointContext; logs a warning when called without a request context.

Written for commit 6b3ac825a35af26f32950815ecd937e65e6e4f8f. 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:** 🔄 Open **Base:** `canary` ← **Head:** `feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin` --- ### 📝 Commits (6) - [`12ab63f`](https://github.com/better-auth/better-auth/commit/12ab63f0bf85944128c09fb5de01842b08a10bed) feat(generic-oauth): add refreshAccessToken extra params to GenericOAuthConfig - [`63a32cc`](https://github.com/better-auth/better-auth/commit/63a32cca6db2561685095288e249f8ee4b19eb84) Update parameter name for consistency - [`d1170a1`](https://github.com/better-auth/better-auth/commit/d1170a1b09cd424195b53d22718dd15928955a05) Merge branch 'better-auth:canary' into feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin - [`442d64e`](https://github.com/better-auth/better-auth/commit/442d64e7ca49e325298be5916c03450487e5cdf7) refactor(generic-oauth): rename refreshTokenParams to refreshTokenUrlParams - [`5a07cf3`](https://github.com/better-auth/better-auth/commit/5a07cf39048f0e301be17a074a40407aca43eb3f) Merge branch 'canary' into feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin - [`6b3ac82`](https://github.com/better-auth/better-auth/commit/6b3ac825a35af26f32950815ecd937e65e6e4f8f) Merge branch 'canary' into feat/pass-extra-params-for-refresh-token-flow-in-generic-oauth-plugin ### 📊 Changes **4 files changed** (+142 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/generic-oauth.mdx` (+5 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts` (+103 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+24 -1) 📝 `packages/better-auth/src/plugins/generic-oauth/types.ts` (+10 -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 and forwards it to refreshAccessToken, allowing extra params in refresh token requests. Supports a static object or a function that receives GenericEndpointContext; logs a warning when called without a request context. <sup>Written for commit 6b3ac825a35af26f32950815ecd937e65e6e4f8f. 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-03-13 13:37:53 -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#7473