[PR #7145] [MERGED] chore(core): add getPlugin API in AuthContext #7100

Closed
opened 2026-03-13 13:24:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: canaryHead: himself65/2026/01/06/get-plugin


📝 Commits (2)

  • 24eea09 feat(core): add getPlugin API in AuthContext
  • c707be0 chore: update snap

📊 Changes

7 files changed (+41 additions, -16 deletions)

View changed files

📝 packages/better-auth/src/context/__snapshots__/create-context.test.ts.snap (+1 -0)
📝 packages/better-auth/src/context/create-context.ts (+10 -2)
📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+1 -3)
📝 packages/core/src/types/context.ts (+8 -1)
📝 packages/core/src/types/index.ts (+1 -0)
📝 packages/oauth-provider/src/client-resource.ts (+17 -7)
📝 packages/oauth-provider/src/utils/index.ts (+3 -3)

📄 Description

Summary by cubic

Added AuthContext.getPlugin for type-safe plugin lookup and updated OIDC/OAuth code to use it for JWT. This makes plugin access simpler and safer.

  • New Features

    • Added AuthContext.getPlugin(id) returning Plugin or null.
    • Exported PluginContext type from core.
  • Refactors

    • Replaced manual plugin search with getPlugin in OIDC Provider, OAuth utils, and client resource; added lazy JWT plugin lookup.

Written for commit c707be0613. 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/7145 **Author:** [@himself65](https://github.com/himself65) **Created:** 1/6/2026 **Status:** ✅ Merged **Merged:** 1/6/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2026/01/06/get-plugin` --- ### 📝 Commits (2) - [`24eea09`](https://github.com/better-auth/better-auth/commit/24eea09f8efe082dab43640a6abf8f9069b9d663) feat(core): add `getPlugin` API in `AuthContext` - [`c707be0`](https://github.com/better-auth/better-auth/commit/c707be0613ca7c5659801794c49a7372036a8a13) chore: update snap ### 📊 Changes **7 files changed** (+41 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/context/__snapshots__/create-context.test.ts.snap` (+1 -0) 📝 `packages/better-auth/src/context/create-context.ts` (+10 -2) 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+1 -3) 📝 `packages/core/src/types/context.ts` (+8 -1) 📝 `packages/core/src/types/index.ts` (+1 -0) 📝 `packages/oauth-provider/src/client-resource.ts` (+17 -7) 📝 `packages/oauth-provider/src/utils/index.ts` (+3 -3) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Added AuthContext.getPlugin for type-safe plugin lookup and updated OIDC/OAuth code to use it for JWT. This makes plugin access simpler and safer. - **New Features** - Added AuthContext.getPlugin<Plugin>(id) returning Plugin or null. - Exported PluginContext type from core. - **Refactors** - Replaced manual plugin search with getPlugin in OIDC Provider, OAuth utils, and client resource; added lazy JWT plugin lookup. <sup>Written for commit c707be0613ca7c5659801794c49a7372036a8a13. 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-03-13 13:24:06 -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#7100