[PR #5944] [MERGED] fix: use ctx over request in plugin options #31940

Closed
opened 2026-04-17 22:48:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5944
Author: @ping-maxwell
Created: 11/12/2025
Status: Merged
Merged: 11/13/2025
Merged by: @himself65

Base: canaryHead: fix/use-ctx-over-request-for-plugin-options


📝 Commits (1)

  • 519a21c fix: use ctx over request in plugin options

📊 Changes

7 files changed (+29 additions, -26 deletions)

View changed files

📝 packages/better-auth/src/plugins/email-otp/index.ts (+9 -9)
📝 packages/better-auth/src/plugins/magic-link/index.ts (+2 -2)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/routes/crud-team.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/types.ts (+3 -3)
📝 packages/better-auth/src/plugins/phone-number/index.ts (+11 -8)
📝 packages/better-auth/src/plugins/two-factor/otp/index.ts (+2 -2)

📄 Description

linear: https://linear.app/better-auth/issue/ENG-457/change-all-request-callback-params-on-better-auth-options-to-be
closes: https://github.com/better-auth/better-auth/issues/5300

Breaking Change

Many plugin options which allow request have now been convert to ctx. You can still access request, it's under ctx.request.

Endpoints changed: email-otp, magic-link, organization, phone-number, two-factor


🔄 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/5944 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 11/12/2025 **Status:** ✅ Merged **Merged:** 11/13/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/use-ctx-over-request-for-plugin-options` --- ### 📝 Commits (1) - [`519a21c`](https://github.com/better-auth/better-auth/commit/519a21c0c09cef0eb89815c40105e33aacba1a84) fix: use `ctx` over `request` in plugin options ### 📊 Changes **7 files changed** (+29 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/email-otp/index.ts` (+9 -9) 📝 `packages/better-auth/src/plugins/magic-link/index.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/routes/crud-team.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/types.ts` (+3 -3) 📝 `packages/better-auth/src/plugins/phone-number/index.ts` (+11 -8) 📝 `packages/better-auth/src/plugins/two-factor/otp/index.ts` (+2 -2) </details> ### 📄 Description linear: https://linear.app/better-auth/issue/ENG-457/change-all-request-callback-params-on-better-auth-options-to-be closes: https://github.com/better-auth/better-auth/issues/5300 ## Breaking Change Many plugin options which allow `request` have now been convert to `ctx`. You can still access request, it's under `ctx.request`. Endpoints changed: email-otp, magic-link, organization, phone-number, two-factor --- <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-17 22:48:54 -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#31940