Next.js Discord

Discord Forum

Auth Sessions

Unanswered
American Chinchilla posted this in #help-forum
Open in Discord
American ChinchillaOP
I am following this guide: https://nextjs.org/docs/app/building-your-application/authentication#2-encrypting-and-decrypting-sessions

On the app/lib/session.ts example they have a type called SessionPayload but it is not defined in app/lib/definitions.ts is there more source code that I'm not seeing?

2 Replies

@American Chinchilla I am following this guide: https://nextjs.org/docs/app/building-your-application/authentication#2-encrypting-and-decrypting-sessions On the `app/lib/session.ts` example they have a type called `SessionPayload` but it is not defined in `app/lib/definitions.ts` is there more source code that I'm not seeing?
the SessionPayload is the object that contains your user data. They only tell you:
The payload should contain the minimum, unique user data that'll be used in subsequent requests, such as the user's ID, role, etc. ...
so it's up to you how you define the data that is contained inside your jwt token
@American Chinchilla solved?