[PR #5393] [MERGED] fix(expo): set-header retrigger $sessionSignal #14223

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5393
Author: @himself65
Created: 10/17/2025
Status: Merged
Merged: 10/19/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/17/expo


📝 Commits (10+)

📊 Changes

2 files changed (+198 additions, -9 deletions)

View changed files

📝 packages/expo/src/client.ts (+128 -9)
📝 packages/expo/src/expo.test.ts (+70 -0)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4744


Summary by cubic

Prevented infinite session refetch loops in the Expo client by only retriggering $sessionSignal when the Set-Cookie header contains better-auth cookies. Fixes better-auth/better-auth#4744.

  • Bug Fixes
    • Added hasBetterAuthCookies(setCookieHeader, cookiePrefix) to detect better-auth cookies, including __Secure- prefixed names.
    • Only update stored cookies and notify $sessionSignal when detection passes; respects custom storagePrefix.
    • Added tests for better-auth, secure, non-auth (e.g., __cf_bm), mixed, and custom prefix scenarios.

🔄 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/5393 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/17/2025 **Status:** ✅ Merged **Merged:** 10/19/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/17/expo` --- ### 📝 Commits (10+) - [`d1b57b2`](https://github.com/better-auth/better-auth/commit/d1b57b27d207afb37a2149d2b54ddc4e303f6fb3) fix: set-header retrigger `$sessionSignal` - [`b31a0bf`](https://github.com/better-auth/better-auth/commit/b31a0bf1d85c1a5ebce721f1d2e36d717af3018e) fix: bug - [`686f9b6`](https://github.com/better-auth/better-auth/commit/686f9b61ab939a19ca6ff8a5ce36ec0d8a7925ba) test: add - [`7070fc6`](https://github.com/better-auth/better-auth/commit/7070fc680ed9c0db310ee73b94b39e956491a3da) chore: fix - [`1ff8eed`](https://github.com/better-auth/better-auth/commit/1ff8eed6e5bbee57c3d85de63567814a52b5d910) chore: fix only check session - [`59957c7`](https://github.com/better-auth/better-auth/commit/59957c78568d647c5a866d5f8b3a514443ef2733) fix(expo): cookie cache? - [`d948382`](https://github.com/better-auth/better-auth/commit/d9483825a4c527dd50e52b5917f3c18fa3e3ae2b) Revert "fix(expo): cookie cache?" - [`5e60427`](https://github.com/better-auth/better-auth/commit/5e60427a35bbccf21c751eae0f6fc5c0529e315c) fix(expo): equal check - [`614bf55`](https://github.com/better-auth/better-auth/commit/614bf55407befcc15507a1b5aea7ef4f0c310098) fix(expo): equal check - [`a1dafd1`](https://github.com/better-auth/better-auth/commit/a1dafd102bce07db0086013a536a796c1882135f) chore: fix lint ### 📊 Changes **2 files changed** (+198 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/expo/src/client.ts` (+128 -9) 📝 `packages/expo/src/expo.test.ts` (+70 -0) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4744 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Prevented infinite session refetch loops in the Expo client by only retriggering $sessionSignal when the Set-Cookie header contains better-auth cookies. Fixes better-auth/better-auth#4744. - **Bug Fixes** - Added hasBetterAuthCookies(setCookieHeader, cookiePrefix) to detect better-auth cookies, including __Secure- prefixed names. - Only update stored cookies and notify $sessionSignal when detection passes; respects custom storagePrefix. - Added tests for better-auth, secure, non-auth (e.g., __cf_bm), mixed, and custom prefix scenarios. <!-- 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-04-13 09:22:00 -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#14223