[PR #4992] feat(oauth): add support for custom provider-specific options in authorization #5699

Open
opened 2026-03-13 12:32:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4992
Author: @himself65
Created: 9/30/2025
Status: 🔄 Open

Base: canaryHead: himself65/2025/09/30/oauth


📝 Commits (2)

  • ddae85d feat(oauth): add support for custom provider-specific options in authorization
  • a9ec5f7 fix: rename

📊 Changes

4 files changed (+51 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/api/routes/account.test.ts (+29 -0)
📝 packages/better-auth/src/api/routes/account.ts (+13 -0)
📝 packages/better-auth/src/oauth2/types.ts (+4 -0)
📝 packages/better-auth/src/social-providers/google.ts (+5 -2)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/2351

Summary by cubic

Adds support for provider-specific OAuth options in authorization requests so clients can pass custom params like access_type and prompt. This enables flows such as Google offline access and consent without changing provider config.

  • New Features
    • linkSocial now accepts an options object with provider-specific params.
    • OAuthProvider.buildAuthorizationUrl type allows additional keys.
    • Google provider reads prompt and accessType from request and overrides defaults.
    • Added test to verify options are included in the authorization URL (access_type=offline, prompt=consent).

🔄 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/4992 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/30/2025 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `himself65/2025/09/30/oauth` --- ### 📝 Commits (2) - [`ddae85d`](https://github.com/better-auth/better-auth/commit/ddae85d5234ebb48dba8d1a38b90fbc1c3303cf4) feat(oauth): add support for custom provider-specific options in authorization - [`a9ec5f7`](https://github.com/better-auth/better-auth/commit/a9ec5f7461cf00d1159f3483d3365d0ddc20b66b) fix: rename ### 📊 Changes **4 files changed** (+51 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/account.test.ts` (+29 -0) 📝 `packages/better-auth/src/api/routes/account.ts` (+13 -0) 📝 `packages/better-auth/src/oauth2/types.ts` (+4 -0) 📝 `packages/better-auth/src/social-providers/google.ts` (+5 -2) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/2351 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds support for provider-specific OAuth options in authorization requests so clients can pass custom params like access_type and prompt. This enables flows such as Google offline access and consent without changing provider config. - **New Features** - linkSocial now accepts an options object with provider-specific params. - OAuthProvider.buildAuthorizationUrl type allows additional keys. - Google provider reads prompt and accessType from request and overrides defaults. - Added test to verify options are included in the authorization URL (access_type=offline, prompt=consent). <!-- 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 12:32:12 -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#5699