[PR #7294] [MERGED] chore: fix filter server api type #15451

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7294
Author: @jonathansamines
Created: 1/12/2026
Status: Merged
Merged: 1/12/2026
Merged by: @himself65

Base: canaryHead: fix/scoped-server-api


📝 Commits (1)

  • a0a1bf2 fix(better-auth): filter server api

📊 Changes

2 files changed (+17 additions, -16 deletions)

View changed files

📝 packages/better-auth/src/types/api.ts (+5 -14)
📝 packages/better-auth/src/types/types.test.ts (+12 -2)

📄 Description

Summary by cubic

Fixes server API type filtering so only server-safe endpoints are exposed, hiding HTTP-scoped and non-action routes. Also updates type inference to prevent leaking filtered endpoints.

  • Bug Fixes
    • Filtered out endpoints with metadata.isAction: false and metadata.scope: "http".
    • InferAPI now composes InferSessionAPI with FilteredAPI to restrict the surface.
    • Removed unused FilterActions type and added tests to assert exclusions.

Written for commit a0a1bf2624. 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/7294 **Author:** [@jonathansamines](https://github.com/jonathansamines) **Created:** 1/12/2026 **Status:** ✅ Merged **Merged:** 1/12/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/scoped-server-api` --- ### 📝 Commits (1) - [`a0a1bf2`](https://github.com/better-auth/better-auth/commit/a0a1bf26247af8032f279e5688892120619a9318) fix(better-auth): filter server api ### 📊 Changes **2 files changed** (+17 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/types/api.ts` (+5 -14) 📝 `packages/better-auth/src/types/types.test.ts` (+12 -2) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes server API type filtering so only server-safe endpoints are exposed, hiding HTTP-scoped and non-action routes. Also updates type inference to prevent leaking filtered endpoints. - **Bug Fixes** - Filtered out endpoints with metadata.isAction: false and metadata.scope: "http". - InferAPI now composes InferSessionAPI with FilteredAPI to restrict the surface. - Removed unused FilterActions type and added tests to assert exclusions. <sup>Written for commit a0a1bf26247af8032f279e5688892120619a9318. 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:02:16 -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#15451