[PR #7767] Better-auth js integration #7542

Open
opened 2026-03-13 13:40:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7767
Author: @Bekacru
Created: 2/2/2026
Status: 🔄 Open

Base: canaryHead: cursor/better-auth-js-integration-ec21


📝 Commits (1)

  • 7c2cee6 fix(expo): support async storage in client plugin

📊 Changes

2 files changed (+280 additions, -5 deletions)

View changed files

📝 packages/expo/src/client.ts (+16 -4)
📝 packages/expo/test/expo.test.ts (+264 -1)

📄 Description

Fix Expo plugin sign-out not removing sessions from the database by awaiting async storage operations.

The Expo client's storage.getItem() calls were not awaited, leading to incorrect cookie values when an asynchronous storage implementation (like AsyncStorage) was used. This prevented the session token from being sent during sign-out, thus failing to delete the session on the server.


Slack Thread

Open in Cursor Open in Web


Summary by cubic

Fixes Expo client sign-out by awaiting storage.getItem so async storage (e.g., AsyncStorage) reads cookies correctly and the server session is deleted.

  • Bug Fixes
    • Await storage.getItem with Promise.resolve to support both sync and async storage.
    • Sign-out now reliably sends the session token and deletes the DB session; tests added for async storage and bearer-token flows.

Written for commit 7c2cee6ddf. 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/7767 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 2/2/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `cursor/better-auth-js-integration-ec21` --- ### 📝 Commits (1) - [`7c2cee6`](https://github.com/better-auth/better-auth/commit/7c2cee6ddfa0604dfd463b91b464bf78ec5dad3a) fix(expo): support async storage in client plugin ### 📊 Changes **2 files changed** (+280 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/expo/src/client.ts` (+16 -4) 📝 `packages/expo/test/expo.test.ts` (+264 -1) </details> ### 📄 Description Fix Expo plugin sign-out not removing sessions from the database by awaiting async storage operations. The Expo client's `storage.getItem()` calls were not `await`ed, leading to incorrect cookie values when an asynchronous storage implementation (like `AsyncStorage`) was used. This prevented the session token from being sent during sign-out, thus failing to delete the session on the server. --- [Slack Thread](https://betterauth.slack.com/archives/C0A8B5BARUK/p1770059909493239?thread_ts=1770059909.493239&cid=C0A8B5BARUK) <a href="https://cursor.com/background-agent?bcId=bc-87f4e6d8-6aec-5638-b1d1-8137d65d01f3"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-87f4e6d8-6aec-5638-b1d1-8137d65d01f3"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes Expo client sign-out by awaiting storage.getItem so async storage (e.g., AsyncStorage) reads cookies correctly and the server session is deleted. - **Bug Fixes** - Await storage.getItem with Promise.resolve to support both sync and async storage. - Sign-out now reliably sends the session token and deletes the DB session; tests added for async storage and bearer-token flows. <sup>Written for commit 7c2cee6ddfa0604dfd463b91b464bf78ec5dad3a. 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:40:56 -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#7542