[PR #1151] [MERGED] feat: support function for trusted origins configuration #3657

Closed
opened 2026-03-13 11:03:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1151
Author: @ping-maxwell
Created: 1/6/2025
Status: Merged
Merged: 2/14/2025
Merged by: @Bekacru

Base: mainHead: refactor/trustedOrigins


📝 Commits (5)

  • f420d3a feat: support function for trusted origins configuration
  • e42e203 pass request object and support promise returns
  • 3e423fc fix types
  • aeaa2c6 Merge branch 'main' into refactor/trustedOrigins
  • b70f3ef chore: lint

📊 Changes

6 files changed (+58 additions, -10 deletions)

View changed files

📝 packages/better-auth/src/api/middlewares/origin-check.test.ts (+29 -0)
📝 packages/better-auth/src/api/middlewares/origin-check.ts (+18 -3)
📝 packages/better-auth/src/auth.ts (+5 -1)
📝 packages/better-auth/src/init.ts (+1 -1)
📝 packages/better-auth/src/types/options.ts (+1 -1)
📝 packages/expo/src/index.ts (+4 -4)

📄 Description

  • Updated the trusted origins option to accept either an array or a function returning an array of origins.
  • Modified middleware and utility functions to handle function-based trusted origins.
  • Enhanced documentation and types to reflect the new trusted origin configuration capabilities.
  • Integrated changes in the Expo plugin for consistent trusted origin handling across environments.

🔄 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/1151 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 1/6/2025 **Status:** ✅ Merged **Merged:** 2/14/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `refactor/trustedOrigins` --- ### 📝 Commits (5) - [`f420d3a`](https://github.com/better-auth/better-auth/commit/f420d3a4f3212fb461db11e8b7f345651c8b6b48) feat: support function for trusted origins configuration - [`e42e203`](https://github.com/better-auth/better-auth/commit/e42e20303e6371721c8264b4d00dd06a57b10fd6) pass request object and support promise returns - [`3e423fc`](https://github.com/better-auth/better-auth/commit/3e423fcfcb28d05a24e48fba9083b13dd3f987ed) fix types - [`aeaa2c6`](https://github.com/better-auth/better-auth/commit/aeaa2c67c4472c7da84d7f5e35584baf19f975d3) Merge branch 'main' into refactor/trustedOrigins - [`b70f3ef`](https://github.com/better-auth/better-auth/commit/b70f3ef0a7a714c9726cc9abd6dd55753b0f285c) chore: lint ### 📊 Changes **6 files changed** (+58 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/middlewares/origin-check.test.ts` (+29 -0) 📝 `packages/better-auth/src/api/middlewares/origin-check.ts` (+18 -3) 📝 `packages/better-auth/src/auth.ts` (+5 -1) 📝 `packages/better-auth/src/init.ts` (+1 -1) 📝 `packages/better-auth/src/types/options.ts` (+1 -1) 📝 `packages/expo/src/index.ts` (+4 -4) </details> ### 📄 Description - Updated the trusted origins option to accept either an array or a function returning an array of origins. - Modified middleware and utility functions to handle function-based trusted origins. - Enhanced documentation and types to reflect the new trusted origin configuration capabilities. - Integrated changes in the Expo plugin for consistent trusted origin handling across environments. --- <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 11:03:28 -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#3657