[PR #5359] [MERGED] fix: correct type HookEndpointContext and InternalContext #5955

Closed
opened 2026-03-13 12:42:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5359
Author: @himself65
Created: 10/16/2025
Status: Merged
Merged: 10/16/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/16/type


📝 Commits (10+)

📊 Changes

13 files changed (+103 additions, -46 deletions)

View changed files

📝 packages/better-auth/src/api/to-auth-endpoints.ts (+16 -9)
📝 packages/better-auth/src/db/internal-adapter.ts (+2 -2)
📝 packages/better-auth/src/db/with-hooks.ts (+16 -6)
📝 packages/better-auth/src/plugins/api-key/types.ts (+5 -2)
📝 packages/better-auth/src/plugins/oauth-proxy/index.ts (+2 -2)
📝 packages/core/src/context/endpoint-context.ts (+21 -5)
📝 packages/core/src/context/index.ts (+7 -1)
📝 packages/core/src/context/transaction.ts (+9 -0)
📝 packages/core/src/types/init-options.ts (+4 -0)
📝 packages/core/src/types/plugin.ts (+9 -7)
📝 packages/expo/src/index.ts (+1 -1)
📝 pnpm-lock.yaml (+10 -10)
📝 pnpm-workspace.yaml (+1 -1)

📄 Description

Summary by cubic

Fixes endpoint context typings so hooks and endpoints can use partial request data without type errors. Introduces a single AuthEndpointContext used across the API and AsyncLocalStorage.

  • Bug Fixes

    • HookEndpointContext and InternalContext now accept partial Endpoint/Input context.
    • Added and exported AuthEndpointContext; getEndpointContext/runWithEndpointContext updated to use it.
    • Aligned GenericEndpointContext with better-call’s updated generics.
  • Dependencies

    • Bumped better-call to 1.0.24.

🔄 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/5359 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/16/2025 **Status:** ✅ Merged **Merged:** 10/16/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/16/type` --- ### 📝 Commits (10+) - [`dd63280`](https://github.com/better-auth/better-auth/commit/dd6328064ffa0fe166f8f87e0f98186af0c8b1b0) fix: correct type `HookEndpointContext` and `InternalContext` - [`5cebc62`](https://github.com/better-auth/better-auth/commit/5cebc6245c799e82b91076ac275b330a48d39230) chore: lint fix - [`2c68700`](https://github.com/better-auth/better-auth/commit/2c687003cb024d8149c0dee22b91df041ce0b4f3) chore: lint fix - [`1db3b9e`](https://github.com/better-auth/better-auth/commit/1db3b9ed5e5d6bba46aa568affca2e3a639bc8a2) chore: lint fix - [`738b86a`](https://github.com/better-auth/better-auth/commit/738b86ac45b8e8be37fa1b6d3215136e9023da66) fix: type - [`85ea471`](https://github.com/better-auth/better-auth/commit/85ea471d16cbc1aa968a271928fe6d24781d77c2) fix: type - [`9721d11`](https://github.com/better-auth/better-auth/commit/9721d111217dd9a7148c05ed597016ba1b650bb1) fix: naming - [`3b1d0b7`](https://github.com/better-auth/better-auth/commit/3b1d0b7c7d5a70232136dd687964b1ae70c6d854) fix: naming - [`fde8d65`](https://github.com/better-auth/better-auth/commit/fde8d653b9a0c441b3579f6b4284f852b89b3b38) feat: export internal - [`d704ccc`](https://github.com/better-auth/better-auth/commit/d704ccc0fc28b1277c4d178c4e43217fd2827814) chore: type fix ### 📊 Changes **13 files changed** (+103 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/to-auth-endpoints.ts` (+16 -9) 📝 `packages/better-auth/src/db/internal-adapter.ts` (+2 -2) 📝 `packages/better-auth/src/db/with-hooks.ts` (+16 -6) 📝 `packages/better-auth/src/plugins/api-key/types.ts` (+5 -2) 📝 `packages/better-auth/src/plugins/oauth-proxy/index.ts` (+2 -2) 📝 `packages/core/src/context/endpoint-context.ts` (+21 -5) 📝 `packages/core/src/context/index.ts` (+7 -1) 📝 `packages/core/src/context/transaction.ts` (+9 -0) 📝 `packages/core/src/types/init-options.ts` (+4 -0) 📝 `packages/core/src/types/plugin.ts` (+9 -7) 📝 `packages/expo/src/index.ts` (+1 -1) 📝 `pnpm-lock.yaml` (+10 -10) 📝 `pnpm-workspace.yaml` (+1 -1) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes endpoint context typings so hooks and endpoints can use partial request data without type errors. Introduces a single AuthEndpointContext used across the API and AsyncLocalStorage. - **Bug Fixes** - HookEndpointContext and InternalContext now accept partial Endpoint/Input context. - Added and exported AuthEndpointContext; getEndpointContext/runWithEndpointContext updated to use it. - Aligned GenericEndpointContext with better-call’s updated generics. - **Dependencies** - Bumped better-call to 1.0.24. <!-- 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-03-13 12:42: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#5955