Search code examples
node.jsstrapi

How to encode more user data into jwt token in Strapi cms


I fell in love in Strapi headless cms. It is an awesome tool reducing several days of effort of programming.

For some reason I need to add more user data into the default jwt token.

How to add more user data into default jwt token

Is this possible at all ?


Solution

  • The encryption of the data is done during the login.

    If you want to add more data, you will have to customize the connect function of the Auth controller.

    This line to be specific.

    Here is the documentation of how to customize plugins functions.