mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 15:44:59 +00:00
Fix auto set config if doent exist
This commit is contained in:
parent
455ff3ed68
commit
832617159d
File diff suppressed because one or more lines are too long
@ -16,9 +16,12 @@ const uuid = require('uuid/v4');
|
||||
module.exports = cb => {
|
||||
if (!_.get(strapi.plugins['users-permissions'], 'config.jwtSecret')) {
|
||||
try {
|
||||
const jwtSecret = uuid();
|
||||
fs.writeFileSync(path.join(strapi.config.appPath, 'plugins', 'users-permissions', 'config', 'jwt.json'), JSON.stringify({
|
||||
jwtSecret: uuid()
|
||||
jwtSecret
|
||||
}, null, 2), 'utf8');
|
||||
|
||||
_.set(strapi.plugins['users-permissions'], 'config.jwtSecret', jwtSecret);
|
||||
} catch(err) {
|
||||
strapi.log.error(err);
|
||||
}
|
||||
|
||||
@ -226,6 +226,7 @@ module.exports = {
|
||||
|
||||
try {
|
||||
fs.writeFileSync(roleConfigPath, stringify({ roles: data }, null, 2), 'utf8');
|
||||
_.set(strapi.plugins['users-permissions'], 'config.roles', data);
|
||||
} catch(err) {
|
||||
strapi.log.error(err);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user