Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jwt): argument salt should not be required in getToken method of @auth/core/jwt #10463

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jdmnk
Copy link

@jdmnk jdmnk commented Apr 2, 2024

☕️ Reasoning

In getToken function of the @auth/core/jwt lib, the salt argument is required even though it has a default value set in the function body. Given that the developer is likely not aware of which salt value is used for encoding jwt, it would make sense to make it optional since the default value will work for most cases.

I have fixed the issue by changing salt to be a Partial<Pick<>> - this makes it optional and retains the full type reference at the same time (e.g. comment on salt property from source interface).

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Relates to: #9133 #10293

📌 Resources

@jdmnk jdmnk requested a review from ThangHuuVu as a code owner April 2, 2024 12:34
Copy link

vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2024 9:48pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Apr 8, 2024 9:48pm

Copy link

vercel bot commented Apr 2, 2024

Someone is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the core Refers to `@auth/core` label Apr 2, 2024
@jdmnk jdmnk changed the title Argument salt should not be required in getToken method of @auth/core/jwt fix(jwt): argument salt should not be required in getToken method of @auth/core/jwt Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants