[PR #5545] [MERGED] fix(expo): origin check failing due to null origin in expo #6073

Closed
opened 2026-03-13 12:46:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5545
Author: @Bekacru
Created: 10/24/2025
Status: Merged
Merged: 10/24/2025
Merged by: @Bekacru

Base: canaryHead: fix/expo-origin


📝 Commits (4)

📊 Changes

6 files changed (+1045 additions, -562 deletions)

View changed files

📝 demo/expo-example/package.json (+14 -11)
📝 demo/nextjs/package.json (+1 -1)
📝 packages/better-auth/src/api/index.ts (+10 -0)
📝 packages/expo/src/index.ts (+6 -4)
📝 packages/expo/test/expo.test.ts (+80 -1)
📝 pnpm-lock.yaml (+934 -545)

📄 Description

closes #5536


Summary by cubic

Fixes Expo origin check failures by overriding a null Origin header with a new expo-origin header, ensuring auth requests succeed in Expo environments.

  • Bug Fixes

    • Set expo-origin in the Expo client and use it server-side to populate Origin when missing.
    • Added disableOriginOverride option to opt out of the override behavior.
    • Updated router to handle rate-limit middleware responses that return a request object.
    • Added test to confirm origin override works during email sign-in.
  • Dependencies

    • Bumped Expo and related demo app packages; updated pnpm lockfile.

🔄 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/5545 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 10/24/2025 **Status:** ✅ Merged **Merged:** 10/24/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/expo-origin` --- ### 📝 Commits (4) - [`7a278d3`](https://github.com/better-auth/better-auth/commit/7a278d35d5d503aea48e436bbea8530659d8c71d) fix(expo): orgin failing due to null origin in expo - [`072851c`](https://github.com/better-auth/better-auth/commit/072851cef0bf0e2da49c0b080c1c17e09e1de62e) add test - [`0c63055`](https://github.com/better-auth/better-auth/commit/0c6305563f184062d07c4f888d0e83215f7966ab) add test - [`255e2f3`](https://github.com/better-auth/better-auth/commit/255e2f33be32d96122b28c796c0d9c5799a2d581) chore: lint ### 📊 Changes **6 files changed** (+1045 additions, -562 deletions) <details> <summary>View changed files</summary> 📝 `demo/expo-example/package.json` (+14 -11) 📝 `demo/nextjs/package.json` (+1 -1) 📝 `packages/better-auth/src/api/index.ts` (+10 -0) 📝 `packages/expo/src/index.ts` (+6 -4) 📝 `packages/expo/test/expo.test.ts` (+80 -1) 📝 `pnpm-lock.yaml` (+934 -545) </details> ### 📄 Description closes #5536 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes Expo origin check failures by overriding a null Origin header with a new expo-origin header, ensuring auth requests succeed in Expo environments. - **Bug Fixes** - Set expo-origin in the Expo client and use it server-side to populate Origin when missing. - Added disableOriginOverride option to opt out of the override behavior. - Updated router to handle rate-limit middleware responses that return a request object. - Added test to confirm origin override works during email sign-in. - **Dependencies** - Bumped Expo and related demo app packages; updated pnpm lockfile. <!-- 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 12:46:30 -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#6073