[PR #3914] [MERGED] fix: allow returning response object to skip after hooks #21983

Closed
opened 2026-04-15 20:43:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3914
Author: @Bekacru
Created: 8/11/2025
Status: Merged
Merged: 8/11/2025
Merged by: @Bekacru

Base: canaryHead: fix/allow-response


📝 Commits (3)

  • b8f65a8 fix: allow returning response object to skip after hooks
  • 1679dce add mcp test
  • 1d9cc55 check if result is defined

📊 Changes

4 files changed (+11 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/api/to-auth-endpoints.ts (+7 -0)
📝 packages/better-auth/src/plugins/mcp/index.ts (+1 -1)
📝 packages/better-auth/src/plugins/mcp/mcp.test.ts (+3 -0)
packages/better-auth/src/telemetry/README.md (+0 -0)

📄 Description

Summary by cubic

Updated the auth endpoint handler to allow returning a Response object, which skips after hooks and post-processing.

  • Bug Fixes
    • Returning a Response now bypasses extra processing steps.
    • Updated MCP plugin to use Response directly.
    • Added a test for the new behavior.
    • Removed unused telemetry README.

🔄 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/3914 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 8/11/2025 **Status:** ✅ Merged **Merged:** 8/11/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/allow-response` --- ### 📝 Commits (3) - [`b8f65a8`](https://github.com/better-auth/better-auth/commit/b8f65a8fcb3b98213e7fab2a190f9b88db226632) fix: allow returning response object to skip after hooks - [`1679dce`](https://github.com/better-auth/better-auth/commit/1679dcee9d37ea05ab4bba97f16d77410f380269) add mcp test - [`1d9cc55`](https://github.com/better-auth/better-auth/commit/1d9cc553dda6c2da69b40f0852fc2d3416713a72) check if result is defined ### 📊 Changes **4 files changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/to-auth-endpoints.ts` (+7 -0) 📝 `packages/better-auth/src/plugins/mcp/index.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/mcp/mcp.test.ts` (+3 -0) ➖ `packages/better-auth/src/telemetry/README.md` (+0 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Updated the auth endpoint handler to allow returning a Response object, which skips after hooks and post-processing. - **Bug Fixes** - Returning a Response now bypasses extra processing steps. - Updated MCP plugin to use Response directly. - Added a test for the new behavior. - Removed unused telemetry README. <!-- 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-15 20:43:59 -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#21983