Skip to main content
During the lifecycle of a request you will be able to access the data you have configured to be stored in the JWT by accessing req.user. The user object is automatically appended to the request for you.

Defining Token Data

You can specify what data gets encoded to the Cookie/JWT-Token by setting saveToJWT property on fields within your auth collection.
Tip:If you wish to use a different key other than the field name, you can define saveToJWT as a string.

Using Token Data

This is especially helpful when writing Hooks and Access Control that depend on user defined fields.