[PR #3824] [MERGED] fix: client secret should be optional in configuring the generic oauth plugin #21928

Closed
opened 2026-04-15 20:42:10 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3824
Author: @frectonz
Created: 8/6/2025
Status: Merged
Merged: 8/6/2025
Merged by: @Bekacru

Base: canaryHead: fix/optional-client-secret


📝 Commits (3)

  • 17c907e fix: client secret should be optional because not all oauth authorizations method require it
  • 230d31a fix: use empty string as a secret fallback
  • 2d69ad3 fix: don't use else if

📊 Changes

4 files changed (+10 additions, -6 deletions)

View changed files

📝 packages/better-auth/src/oauth2/refresh-access-token.ts (+4 -2)
📝 packages/better-auth/src/oauth2/types.ts (+1 -1)
📝 packages/better-auth/src/oauth2/validate-authorization-code.ts (+4 -2)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+1 -1)

📄 Description

Not all oauth2 authorization flows require a client secret some use client assertions, this PR make the clientSecret field on the generic oauth plugin optional.


Summary by cubic

Made the clientSecret field optional in the generic OAuth plugin to support providers that do not require a client secret.

  • Bug Fixes
    • Updated type definitions and logic to handle cases where clientSecret is not provided.

🔄 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/3824 **Author:** [@frectonz](https://github.com/frectonz) **Created:** 8/6/2025 **Status:** ✅ Merged **Merged:** 8/6/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/optional-client-secret` --- ### 📝 Commits (3) - [`17c907e`](https://github.com/better-auth/better-auth/commit/17c907e62c1dbe83df47b1c32ae553a233e379b1) fix: client secret should be optional because not all oauth authorizations method require it - [`230d31a`](https://github.com/better-auth/better-auth/commit/230d31aeb07673094798aaba23cf6817c12e3dfd) fix: use empty string as a secret fallback - [`2d69ad3`](https://github.com/better-auth/better-auth/commit/2d69ad361ef1f2aa9648e0f864a4698163e094ce) fix: don't use else if ### 📊 Changes **4 files changed** (+10 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/oauth2/refresh-access-token.ts` (+4 -2) 📝 `packages/better-auth/src/oauth2/types.ts` (+1 -1) 📝 `packages/better-auth/src/oauth2/validate-authorization-code.ts` (+4 -2) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+1 -1) </details> ### 📄 Description Not all oauth2 authorization flows require a client secret some use client assertions, this PR make the `clientSecret` field on the generic oauth plugin optional. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Made the clientSecret field optional in the generic OAuth plugin to support providers that do not require a client secret. - **Bug Fixes** - Updated type definitions and logic to handle cases where clientSecret is not provided. <!-- 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-15 20:42:10 -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#21928