[PR #8219] [MERGED] fix(oauth-proxy): add generic OAuth support to proxy (#8082) #7827

Closed
opened 2026-03-13 13:50:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8219
Author: @Bekacru
Created: 2/28/2026
Status: Merged
Merged: 2/28/2026
Merged by: @Bekacru

Base: mainHead: cherry-pick/oauth-proxy-generic-oauth


📝 Commits (1)

  • b27ac41 fix(oauth-proxy): add generic OAuth support to proxy (#8082)

📊 Changes

5 files changed (+145 additions, -12 deletions)

View changed files

📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+9 -3)
📝 packages/better-auth/src/plugins/generic-oauth/routes.ts (+8 -3)
📝 packages/better-auth/src/plugins/oauth-proxy/index.ts (+17 -4)
📝 packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts (+109 -0)
📝 packages/better-auth/src/state.ts (+2 -2)

📄 Description

Cherry-pick of the latest canary commit (0deaaa4e67c3067bd3b0570b3adfef2b532c7085) to main.

Original PR: #8082

Changes:

  • Adds generic OAuth support to the oauth-proxy
  • Ensures redirect_uri always matches the actual callback URL to prevent invalid_code during token exchange
  • Unifies callback matching and fixes state cleanup for UUID/database mode

Files changed:

  • packages/better-auth/src/plugins/generic-oauth/index.ts
  • packages/better-auth/src/plugins/generic-oauth/routes.ts
  • packages/better-auth/src/plugins/oauth-proxy/index.ts
  • packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts
  • packages/better-auth/src/state.ts

🔄 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/8219 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 2/28/2026 **Status:** ✅ Merged **Merged:** 2/28/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `cherry-pick/oauth-proxy-generic-oauth` --- ### 📝 Commits (1) - [`b27ac41`](https://github.com/better-auth/better-auth/commit/b27ac414ef437f258355e7f1c01d838f91ff7b3f) fix(oauth-proxy): add generic OAuth support to proxy (#8082) ### 📊 Changes **5 files changed** (+145 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+9 -3) 📝 `packages/better-auth/src/plugins/generic-oauth/routes.ts` (+8 -3) 📝 `packages/better-auth/src/plugins/oauth-proxy/index.ts` (+17 -4) 📝 `packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts` (+109 -0) 📝 `packages/better-auth/src/state.ts` (+2 -2) </details> ### 📄 Description Cherry-pick of the latest canary commit (`0deaaa4e67c3067bd3b0570b3adfef2b532c7085`) to main. **Original PR:** #8082 **Changes:** - Adds generic OAuth support to the oauth-proxy - Ensures `redirect_uri` always matches the actual callback URL to prevent `invalid_code` during token exchange - Unifies callback matching and fixes state cleanup for UUID/database mode **Files changed:** - `packages/better-auth/src/plugins/generic-oauth/index.ts` - `packages/better-auth/src/plugins/generic-oauth/routes.ts` - `packages/better-auth/src/plugins/oauth-proxy/index.ts` - `packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts` - `packages/better-auth/src/state.ts` --- <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:50:24 -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#7827