[PR #6887] [MERGED] fix: trusted origins resolving #15191

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6887
Author: @Bekacru
Created: 12/19/2025
Status: Merged
Merged: 12/19/2025
Merged by: @Bekacru

Base: canaryHead: fix/trsuted-origins


📝 Commits (1)

  • cdebe42 fix: trusted origins resolving

📊 Changes

3 files changed (+22 additions, -24 deletions)

View changed files

📝 packages/better-auth/src/auth/base.ts (+1 -7)
📝 packages/better-auth/src/context/create-context.ts (+9 -10)
📝 packages/better-auth/src/context/helpers.ts (+12 -7)

📄 Description

Summary by cubic

Fixes trusted origin resolution so redirect and origin checks use the correct list on every request. Origins from baseURL, env, and per-request functions are now merged in one place.

  • Bug Fixes
    • Centralized origin resolution in async getTrustedOrigins(options, request) and use it in context and request handler.
    • Support options.trustedOrigins as an array or per-request function; merge with BETTER_AUTH_TRUSTED_ORIGINS.
    • Handle missing baseURL gracefully; still resolve other origins and log a warning instead of an error.

Written for commit cdebe42074. Summary will update automatically 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/6887 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 12/19/2025 **Status:** ✅ Merged **Merged:** 12/19/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/trsuted-origins` --- ### 📝 Commits (1) - [`cdebe42`](https://github.com/better-auth/better-auth/commit/cdebe4207440b2e36429b1c019892fc8acd08842) fix: trusted origins resolving ### 📊 Changes **3 files changed** (+22 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/auth/base.ts` (+1 -7) 📝 `packages/better-auth/src/context/create-context.ts` (+9 -10) 📝 `packages/better-auth/src/context/helpers.ts` (+12 -7) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes trusted origin resolution so redirect and origin checks use the correct list on every request. Origins from baseURL, env, and per-request functions are now merged in one place. - **Bug Fixes** - Centralized origin resolution in async getTrustedOrigins(options, request) and use it in context and request handler. - Support options.trustedOrigins as an array or per-request function; merge with BETTER_AUTH_TRUSTED_ORIGINS. - Handle missing baseURL gracefully; still resolve other origins and log a warning instead of an error. <sup>Written for commit cdebe4207440b2e36429b1c019892fc8acd08842. Summary will update automatically 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-13 09:52:51 -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#15191