[PR #7766] Expo state mismatch #24442

Open
opened 2026-04-15 22:22:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: cursor/expo-state-mismatch-394c


📝 Commits (1)

  • dbe888a test(expo): add end-to-end test for database strategy OAuth flow

📊 Changes

1 file changed (+56 additions, -0 deletions)

View changed files

📝 packages/expo/test/expo.test.ts (+56 -0)

📄 Description

Add an end-to-end test for the Expo database strategy to verify correct state cookie handling by the expo-authorization-proxy.

This PR addresses state mismatch issues with Expo by adding a test to ensure the expo-authorization-proxy correctly sets the signed state cookie when using the database strategy. This validates the fix introduced in v1.5.0-beta.7+ (PR #6933), which was designed to bridge the gap where Expo's system browser couldn't access cookies set by the native app, leading to state validation failures.


Slack Thread

Open in Cursor Open in Web


Summary by cubic

Adds an end-to-end test for the Expo OAuth database strategy to ensure the expo-authorization-proxy sets a signed state cookie in the browser. This guards against state mismatch by verifying oauthState is not in the proxy URL, the state is read from authorizationURL, and a signed state cookie is issued.

Written for commit dbe888a948. 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/7766 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 2/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `cursor/expo-state-mismatch-394c` --- ### 📝 Commits (1) - [`dbe888a`](https://github.com/better-auth/better-auth/commit/dbe888a948186aa51841c194c4abe284cf69d9ad) test(expo): add end-to-end test for database strategy OAuth flow ### 📊 Changes **1 file changed** (+56 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/expo/test/expo.test.ts` (+56 -0) </details> ### 📄 Description Add an end-to-end test for the Expo database strategy to verify correct state cookie handling by the `expo-authorization-proxy`. This PR addresses state mismatch issues with Expo by adding a test to ensure the `expo-authorization-proxy` correctly sets the signed state cookie when using the database strategy. This validates the fix introduced in v1.5.0-beta.7+ (PR #6933), which was designed to bridge the gap where Expo's system browser couldn't access cookies set by the native app, leading to state validation failures. --- [Slack Thread](https://betterauth.slack.com/archives/C0A8B5BARUK/p1770060223898539?thread_ts=1770060223.898539&cid=C0A8B5BARUK) <a href="https://cursor.com/background-agent?bcId=bc-c2798645-ca10-59b3-96cd-fce3d60ef323"><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-c2798645-ca10-59b3-96cd-fce3d60ef323"><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 Adds an end-to-end test for the Expo OAuth database strategy to ensure the expo-authorization-proxy sets a signed state cookie in the browser. This guards against state mismatch by verifying oauthState is not in the proxy URL, the state is read from authorizationURL, and a signed state cookie is issued. <sup>Written for commit dbe888a948186aa51841c194c4abe284cf69d9ad. 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-04-15 22:22:21 -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#24442