[PR #3740] [CLOSED] fix(client): prevent Promise unwrapping interference with proxy paths #13229

Closed
opened 2026-04-13 08:50:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3740
Author: @Kinfe123
Created: 8/1/2025
Status: Closed

Base: mainHead: fix/js-promise-proxy-unwrapping


📝 Commits (8)

📊 Changes

3 files changed (+24 additions, -0 deletions)

View changed files

.changeset/slow-ladybugs-give.md (+5 -0)
📝 packages/better-auth/src/client/client.test.ts (+14 -0)
📝 packages/better-auth/src/client/proxy.ts (+5 -0)

📄 Description

The pr fixes issue regarding to proxy returned by createAuthClient was unintentionally exposing a .then property by design ,resolving it like any other dynamic path (e.g., /api/auth/then). As a result, the runtime or libraries attempting to unwrap the client as a promise would trigger unintended requests to /api/auth/then, leading to unintended behavior.
This could one way introducing a backward compat becasue of the ESM/CJS compat.

closes #3650 or may be #3679


🔄 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/3740 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 8/1/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/js-promise-proxy-unwrapping` --- ### 📝 Commits (8) - [`8ceac01`](https://github.com/better-auth/better-auth/commit/8ceac0188a272542f579ed9b7a91681a825b3f4a) account linking test - [`206b2b9`](https://github.com/better-auth/better-auth/commit/206b2b95be3750f30fdd01733f114894ae40b9bd) handle unwrapping promise - [`96bcfb7`](https://github.com/better-auth/better-auth/commit/96bcfb70b5a5f2e6433fcf539f601e8e9e67e1f3) update - [`60da60d`](https://github.com/better-auth/better-auth/commit/60da60d6b720c5b04cd5975c42a5be71bf77916f) log - [`b0d6a7d`](https://github.com/better-auth/better-auth/commit/b0d6a7de58007f1f5334247dfbdb102dee75e259) changesets - [`7d6272e`](https://github.com/better-auth/better-auth/commit/7d6272e7c420c64a81e7a0d65ad46d25543beae4) Merge branch 'main' into fix/js-promise-proxy-unwrapping - [`f974f3f`](https://github.com/better-auth/better-auth/commit/f974f3f3ac3b663322c27f769e74a9b7ff7403f5) chore: add test - [`2892ad6`](https://github.com/better-auth/better-auth/commit/2892ad6511abaa2c85e209298171711517e00f7e) chore: update test ### 📊 Changes **3 files changed** (+24 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/slow-ladybugs-give.md` (+5 -0) 📝 `packages/better-auth/src/client/client.test.ts` (+14 -0) 📝 `packages/better-auth/src/client/proxy.ts` (+5 -0) </details> ### 📄 Description The pr fixes issue regarding to proxy returned by createAuthClient was unintentionally exposing a .then property by design ,resolving it like any other dynamic path (e.g., /api/auth/then). As a result, the runtime or libraries attempting to unwrap the client as a promise would trigger unintended requests to /api/auth/then, leading to unintended behavior. This could one way introducing a backward compat becasue of the ESM/CJS compat. closes #3650 or may be #3679 --- <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-13 08:50:01 -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#13229