[PR #4073] [CLOSED] feat: export jwt plugin with error #22069

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4073
Author: @dvanmali
Created: 8/18/2025
Status: Closed

Base: canaryHead: getJwtPlugin


📝 Commits (1)

  • 849a837 feat: export jwt plugin with error

📊 Changes

3 files changed (+39 additions, -98 deletions)

View changed files

📝 packages/better-auth/src/plugins/jwt/utils.ts (+11 -80)
📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+12 -18)
📝 packages/better-auth/src/plugins/oidc-provider/oidc.test.ts (+16 -0)

📄 Description

Exports getJwtPlugin for other plugins. Errors early via init to prevent need of checks at runtime.

Removes unused JWT utils from utils.ts. Non-breaking since it is never exported by index.ts.

Partial https://github.com/better-auth/better-auth/pull/3572

Type: PATCH


Summary by cubic

Exports a safe getJwtPlugin helper that throws when the JWT plugin is missing, and updates OIDC to fail fast during init when useJWTPlugin is true. Also removes unused JWT crypto helpers.

  • New Features

    • Exported getJwtPlugin from the JWT plugin; throws BetterAuthError if not found.
    • OIDC provider init checks for JWT plugin when useJWTPlugin is true to prevent runtime failures.
  • Refactors

    • Removed unused JWT encryption/decryption utilities.
    • Replaced OIDC’s local JWT lookup with shared getJwtPlugin.
    • Added a test to ensure init fails without the JWT plugin.

🔄 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/4073 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 8/18/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `getJwtPlugin` --- ### 📝 Commits (1) - [`849a837`](https://github.com/better-auth/better-auth/commit/849a8370c2e9a3ef281df7c9adeaa941a53c10bf) feat: export jwt plugin with error ### 📊 Changes **3 files changed** (+39 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/jwt/utils.ts` (+11 -80) 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+12 -18) 📝 `packages/better-auth/src/plugins/oidc-provider/oidc.test.ts` (+16 -0) </details> ### 📄 Description Exports `getJwtPlugin` for other plugins. Errors early via `init` to prevent need of checks at runtime. Removes unused JWT utils from [utils.ts](packages/better-auth/src/plugins/jwt/utils.ts). Non-breaking since it is never exported by [index.ts](packages/better-auth/src/plugins/jwt/index.ts). Partial https://github.com/better-auth/better-auth/pull/3572 Type: **PATCH** <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Exports a safe getJwtPlugin helper that throws when the JWT plugin is missing, and updates OIDC to fail fast during init when useJWTPlugin is true. Also removes unused JWT crypto helpers. - **New Features** - Exported getJwtPlugin from the JWT plugin; throws BetterAuthError if not found. - OIDC provider init checks for JWT plugin when useJWTPlugin is true to prevent runtime failures. - **Refactors** - Removed unused JWT encryption/decryption utilities. - Replaced OIDC’s local JWT lookup with shared getJwtPlugin. - Added a test to ensure init fails without the JWT plugin. <!-- 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:47:47 -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#22069