[PR #5986] [CLOSED] feat(oauth-proxy): OAuth proxy that works even in stateless mode #6363

Closed
opened 2026-03-13 12:56:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5986
Author: @bytaesu
Created: 11/14/2025
Status: Closed

Base: canaryHead: 2025-11-14/feat/stateless-oauth-proxy


📝 Commits (2)

  • 7989c67 feat(oauth-proxy): OAuth proxy that works in stateless mode
  • d840031 test: add stateless mode test cases

📊 Changes

2 files changed (+205 additions, -13 deletions)

View changed files

📝 packages/better-auth/src/plugins/oauth-proxy/index.ts (+40 -11)
📝 packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts (+165 -2)

📄 Description

Context -> https://discord.com/channels/1288403910284935179/1438696563936333946

Tasks

  • Add support for stateless mode
  • Add test cases
  • Test with a real app

Summary by cubic

Enabled the OAuth proxy to work in stateless mode by reading and decrypting the OAuth state from a cookie. This removes database state lookups while keeping the existing database strategy intact.

  • New Features
    • Added cookie-based state handling (storeStateStrategy: "cookie") with symmetric decryption using the app secret.
    • Skips internalAdapter.findVerificationValue in stateless mode; only sets skipStateCookieCheck for the database strategy.
    • Added tests for stateless and secondary storage flows, validating redirect to oauth-proxy-callback with encrypted cookies.

Written for commit d8400318a8. Summary will update automatically 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/5986 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 11/14/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `2025-11-14/feat/stateless-oauth-proxy` --- ### 📝 Commits (2) - [`7989c67`](https://github.com/better-auth/better-auth/commit/7989c677046f38369aeab489c158dc8850b32d01) feat(oauth-proxy): OAuth proxy that works in stateless mode - [`d840031`](https://github.com/better-auth/better-auth/commit/d8400318a857fb7f5257ea5dbf5575efaebd309c) test: add stateless mode test cases ### 📊 Changes **2 files changed** (+205 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/oauth-proxy/index.ts` (+40 -11) 📝 `packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts` (+165 -2) </details> ### 📄 Description Context -> https://discord.com/channels/1288403910284935179/1438696563936333946 ### Tasks - [x] Add support for stateless mode - [x] Add test cases - [ ] Test with a real app <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Enabled the OAuth proxy to work in stateless mode by reading and decrypting the OAuth state from a cookie. This removes database state lookups while keeping the existing database strategy intact. - **New Features** - Added cookie-based state handling (storeStateStrategy: "cookie") with symmetric decryption using the app secret. - Skips internalAdapter.findVerificationValue in stateless mode; only sets skipStateCookieCheck for the database strategy. - Added tests for stateless and secondary storage flows, validating redirect to oauth-proxy-callback with encrypted cookies. <sup>Written for commit d8400318a857fb7f5257ea5dbf5575efaebd309c. Summary will update automatically 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 12:56:04 -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#6363