We accidentally shared a production .env file with a freelancer that had the following tokens:
APP_KEYS, API_TOKEN_SALT, ADMIN_JWT_SECRET, JWT_SECRET
Is there a way to regenerate these with Strapi or could someone kindly point me in the right direction?
I found this post on SO that detailed a method to manually generate some of the new keys, but was hoping to find something official on the format and requirements for Strapi related JWT keys.
To me your linked post looks completely right.
Just create new, fresh & clean strapi project. Start it.
Change the values in .env-File to
abcd and restart to validate. (I wasn’t in need for this up to this point, but that would be my way how I would do it)
For generation of new keys you might want to look into
const Str = require('@supercharge/strings')
const random = Str.random()
const random_WithFiftySymbols = Str.random(50)
Thanks for the response! So there are no requirements to the random strings, they can be anything? Do you know if they have length or format requirements?