bug: jwt plugin #1200

Closed
opened 2026-03-13 08:27:49 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @directormac on GitHub (May 13, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Using bun 1.2.13 this occured to me.

As mentioned here, might be the internal useage of jose in better-auth, as there is no way for us to generate own keypairs, so i put it here.

https://github.com/oven-sh/bun/issues/19629

Current vs. Expected behavior

I think this is more of how jose is used in the plugin.

What version of Better Auth are you using?

1.2.7

Provide environment information

OS: Linux
Browser: firefox

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
plugins: [
jwt({
	jwks: {
			keyPairConfig: { alg: 'EdDSA', crv: 'Ed25519' },
		}
})
]
});

Additional context

No response

Originally created by @directormac on GitHub (May 13, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Using bun 1.2.13 this occured to me. As mentioned here, might be the internal useage of jose in better-auth, as there is no way for us to generate own keypairs, so i put it here. https://github.com/oven-sh/bun/issues/19629 ### Current vs. Expected behavior I think this is more of how jose is used in the plugin. ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash OS: Linux Browser: firefox ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, plugins: [ jwt({ jwks: { keyPairConfig: { alg: 'EdDSA', crv: 'Ed25519' }, } }) ] }); ``` ### Additional context _No response_
Author
Owner

@dosubot[bot] commented on GitHub (Aug 12, 2025):

Hi, @directormac. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a potential bug in Better Auth v1.2.7's jwt plugin when used with bun 1.2.13.
  • The issue may be related to the jose library's handling of EdDSA Ed25519 key pairs.
  • It affects backend JWT configuration and might be linked to bun's internal behavior.
  • A related bun issue was referenced, but no further comments or updates have been provided.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here.
  • If I don’t hear back within 7 days, I will automatically close this issue.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 12, 2025): Hi, @directormac. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a potential bug in Better Auth v1.2.7's jwt plugin when used with bun 1.2.13. - The issue may be related to the jose library's handling of EdDSA Ed25519 key pairs. - It affects backend JWT configuration and might be linked to bun's internal behavior. - A related bun issue was referenced, but no further comments or updates have been provided. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here. - If I don’t hear back within 7 days, I will automatically close this issue. Thanks for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1200