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

Closed
opened 2026-04-13 09:32:30 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5986

State: closed
Merged: No


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.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5986 **State:** closed **Merged:** No --- 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. -->
GiteaMirror added the pull-request label 2026-04-13 09:32:30 -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#14610