[FIX] respect custom ENV_PATH when setting API_TOKEN_SALT

This commit is contained in:
tillschweneker 2021-12-22 10:08:47 +01:00
parent 7e1ef71d9b
commit ac0c306a0b

View File

@ -86,7 +86,7 @@ const createSaltIfNotDefined = () => {
}
const salt = crypto.randomBytes(16).toString('hex');
strapi.fs.appendFile('.env', `API_TOKEN_SALT=${salt}\n`);
strapi.fs.appendFile(process.env.ENV_PATH || '.env', `API_TOKEN_SALT=${salt}\n`);
strapi.config.set('admin.apiToken.salt', salt);
};