Skip to content

docs: Rename misleading function names in authentication #78544

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

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

BlvckParrot
Copy link

@BlvckParrot BlvckParrot commented Apr 25, 2025

What?

  • Improve Documentation by changing misleading function names to more appropriate.

Why?

  • The now used "encrypt" and "decrypt" function names are not appropriate, because the function does not encrypt the Session payload using the new SignJWT(payload).sign(encodedKey) function. This function returns JWT signed string. If you try to decode using Base64 decoder you get the initial payload in plaintext, which can lead to unintentional usage and thinking of that the data in payload is stored in the cookie encrypted without possibility to reverse to original value and developers can think they can safely put some secret values in the payload. If you want to truly encrypt the session payload you must use the new EncryptJWT(payload).encrypt(key) function from "jose" lib

How?

  • rename all "encrypt" functions and keywords with "sign"
  • rename all "decrypt" functions and keywords with "verify"

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Apr 25, 2025
@ijjk
Copy link
Member

ijjk commented Apr 25, 2025

Allow CI Workflow Run

  • approve CI run for commit: 1f3a6bd

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants