[PR #8056] [MERGED] fix: merge trusted origins function from plugin init #15962

Closed
opened 2026-04-13 10:19:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8056
Author: @jslno
Created: 2/19/2026
Status: Merged
Merged: 2/19/2026
Merged by: @Bekacru

Base: canaryHead: 02-18-2026/trusted-origins-fn-init


📝 Commits (2)

  • 6b1bf62 fix: merge trusted origins functions from plugin init
  • a7f8561 chore: cleanup

📊 Changes

2 files changed (+66 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/auth/trusted-origins.test.ts (+37 -0)
📝 packages/better-auth/src/context/helpers.ts (+29 -1)

📄 Description

Summary by cubic

Fixes trusted origin merging so plugin-provided origins from init() are combined with the user’s config. Supports arrays and functions and filters invalid values, ensuring plugin origins are respected.

  • Bug Fixes
    • Collects trustedOrigins from all plugins during init and merges them with user trustedOrigins into a single async resolver (or static list when no functions are present).
    • Adds tests for user dynamic, plugin static, and plugin function origins; filters non-string/empty values; unknown origins remain untrusted.

Written for commit a7f8561b76. 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/8056 **Author:** [@jslno](https://github.com/jslno) **Created:** 2/19/2026 **Status:** ✅ Merged **Merged:** 2/19/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `02-18-2026/trusted-origins-fn-init` --- ### 📝 Commits (2) - [`6b1bf62`](https://github.com/better-auth/better-auth/commit/6b1bf6284c2cfc817b8febd2c33660e590846018) fix: merge trusted origins functions from plugin init - [`a7f8561`](https://github.com/better-auth/better-auth/commit/a7f8561b769bd6e2df50e770906604b0b55510bf) chore: cleanup ### 📊 Changes **2 files changed** (+66 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/auth/trusted-origins.test.ts` (+37 -0) 📝 `packages/better-auth/src/context/helpers.ts` (+29 -1) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes trusted origin merging so plugin-provided origins from init() are combined with the user’s config. Supports arrays and functions and filters invalid values, ensuring plugin origins are respected. - **Bug Fixes** - Collects trustedOrigins from all plugins during init and merges them with user trustedOrigins into a single async resolver (or static list when no functions are present). - Adds tests for user dynamic, plugin static, and plugin function origins; filters non-string/empty values; unknown origins remain untrusted. <sup>Written for commit a7f8561b769bd6e2df50e770906604b0b55510bf. 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-13 10:19:37 -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#15962