vercel / vercel/next.js

Docs: Authentication page states encrypted sessions but the examples are signed instead, which is misleading

Open
#69,413 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
142k
Forks
32.5k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

What is the documentation issue?

The documentation at https://github.com/vercel/next.js/blob/canary/docs/02-app/01-building-your-application/09-authentication/index.mdx#2-encrypting-and-decrypting-sessions states encryption of sessions, but the example's session data is not encrypted.

Instead it is signed with a signature, which is good enough for some purposes but is misleading when discussing "encrypted" sessions.

Either this should be renamed and/or a specific encrypted sessions example also to be added (with authentication tags). The latter can be done for example with crypto or crypto.subtle ciphers

Is there any context that might help us understand?

Encrypted sessions would use an encryption of the data (some crypto algorithms support verification as well, but some don't), hiding the data from the user, whereas signed sessions allow verification of tampering only.

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/app/building-your-application/authentication

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read docs/02-app/01-building-your-application/09-authentication/index.mdx, especially the section on encrypting and decrypting sessions, and compare its wording with the example's signing behavior. Decide whether the section should be renamed or include a separate encrypted-session example using crypto or crypto.subtle ciphers with authentication tags. Done means the documentation accurately distinguishes signed sessions from encrypted sessions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, documentation, security
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.