How to set JWT expiration to years?

Note for Strapi v4 users :
use the config/plugin.js to update the expiration time.
From Fix JWT using wrong file and structure by derrickmehaffy · Pull Request #649 · strapi/documentation · GitHub

module.exports = ({ env }) => ({
    ///...other plugis
      'users-permissions': {
        config: {
          jwt: {
            expiresIn: '1y',
          },
        },
      },
  });
1 Like