[PR #7718] [CLOSED] feat(oauth-proxy): add replicateData option #7512

Closed
opened 2026-03-13 13:39:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7718
Author: @bytaesu
Created: 1/31/2026
Status: Closed

Base: canaryHead: 2026-01-31/feat/oauth-proxy-replicate-data


📝 Commits (6)

  • a03e33a feat(oauth-proxy): add replicateData option
  • ba251f2 fix: adjust process condition
  • eef8d2a fix: state value handling
  • a6af45e fix: id generation
  • 44c6fbb fix: inject fake verification
  • 83d0e9f fix: exisiting user check

📊 Changes

2 files changed (+487 additions, -16 deletions)

View changed files

📝 packages/better-auth/src/plugins/oauth-proxy/index.ts (+141 -16)
📝 packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts (+346 -0)

📄 Description

testing


Summary by cubic

Adds a replicateData option to the oauth-proxy plugin to replicate user, account, and session data across isolated databases during OAuth sign-in. This lets preview or multi-env setups (e.g., Convex previews) complete sign-in without a shared database.

  • New Features
    • New option: replicateData (default false).
    • When enabled, production includes user/session/account in the encrypted payload; target env recreates missing records and persists the session with the same IDs/token.
    • Supports cookie- or database-backed OAuth state; proxies state as needed. Skips creation if records exist and logs errors without blocking sign-in.

Written for commit 83d0e9f28c. Summary will update 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/7718 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/31/2026 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `2026-01-31/feat/oauth-proxy-replicate-data` --- ### 📝 Commits (6) - [`a03e33a`](https://github.com/better-auth/better-auth/commit/a03e33ab4f7f53c667f76ce1ea28c94331485966) feat(oauth-proxy): add replicateData option - [`ba251f2`](https://github.com/better-auth/better-auth/commit/ba251f2bb2ba8fc0cf745c3e803e1fd25307b97b) fix: adjust process condition - [`eef8d2a`](https://github.com/better-auth/better-auth/commit/eef8d2a1d05251e2057375eefe1d53786bc38425) fix: state value handling - [`a6af45e`](https://github.com/better-auth/better-auth/commit/a6af45ef4ea4a029fedf18ea117d29ce8e810abf) fix: id generation - [`44c6fbb`](https://github.com/better-auth/better-auth/commit/44c6fbb839f6c3325967d8d01854efcafdbdb51b) fix: inject fake verification - [`83d0e9f`](https://github.com/better-auth/better-auth/commit/83d0e9f28cfbc1240703d260e3d410dfe4e053c4) fix: exisiting user check ### 📊 Changes **2 files changed** (+487 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/oauth-proxy/index.ts` (+141 -16) 📝 `packages/better-auth/src/plugins/oauth-proxy/oauth-proxy.test.ts` (+346 -0) </details> ### 📄 Description testing <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a replicateData option to the oauth-proxy plugin to replicate user, account, and session data across isolated databases during OAuth sign-in. This lets preview or multi-env setups (e.g., Convex previews) complete sign-in without a shared database. - **New Features** - New option: replicateData (default false). - When enabled, production includes user/session/account in the encrypted payload; target env recreates missing records and persists the session with the same IDs/token. - Supports cookie- or database-backed OAuth state; proxies state as needed. Skips creation if records exist and logs errors without blocking sign-in. <sup>Written for commit 83d0e9f28cfbc1240703d260e3d410dfe4e053c4. Summary will update 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 13:39:52 -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#7512