[PR #3471] [MERGED] fix(jwt): Reimplement fix that allows to generate JWKS with other algorithm than the default one #13087

Closed
opened 2026-04-13 08:44:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3471
Author: @LightTab2
Created: 7/19/2025
Status: Merged
Merged: 7/19/2025
Merged by: @Bekacru

Base: v1.3Head: refix/JWTExtraction


📝 Commits (2)

📊 Changes

2 files changed (+45 additions, -60 deletions)

View changed files

📝 packages/better-auth/src/plugins/jwt/jwt.test.ts (+22 -49)
📝 packages/better-auth/src/plugins/jwt/sign.ts (+23 -11)

📄 Description

I'm afraid the test cases I've made in previous PR were insufficient. PR #2755 reintroduced issue #3218.

This is because tests checked internals, but didn't test the function used in the jwt plugin endpoint.

I've added test case for this and reimplemented the fix. Hope this never occurs again :)


Summary by cubic

Fixed JWKS generation in the JWT plugin to support custom algorithms, not just the default. Added tests to ensure the endpoint works with different algorithms.

  • Bug Fixes
    • Reimplemented key generation logic to respect custom algorithm settings.
    • Added endpoint-level tests to prevent regression.

🔄 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/3471 **Author:** [@LightTab2](https://github.com/LightTab2) **Created:** 7/19/2025 **Status:** ✅ Merged **Merged:** 7/19/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `v1.3` ← **Head:** `refix/JWTExtraction` --- ### 📝 Commits (2) - [`483ab80`](https://github.com/better-auth/better-auth/commit/483ab80b46a2e08923290a4cb0c58ccda5ddb85c) Fixes #3218 (again) - [`b3f1be9`](https://github.com/better-auth/better-auth/commit/b3f1be916ae5bfd4fa1e8e312c8cde4be17aaa9c) Removes clutter from an overdescriptive comment ### 📊 Changes **2 files changed** (+45 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/jwt/jwt.test.ts` (+22 -49) 📝 `packages/better-auth/src/plugins/jwt/sign.ts` (+23 -11) </details> ### 📄 Description I'm afraid the test cases I've made in previous PR were insufficient. PR #2755 reintroduced issue #3218. This is because tests checked internals, but didn't test the function used in the **jwt plugin endpoint**. I've added test case for this and reimplemented the fix. Hope this never occurs again :) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixed JWKS generation in the JWT plugin to support custom algorithms, not just the default. Added tests to ensure the endpoint works with different algorithms. - **Bug Fixes** - Reimplemented key generation logic to respect custom algorithm settings. - Added endpoint-level tests to prevent regression. <!-- 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-13 08:44: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#13087