remove overwritting env var witohut passing by the config

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre Bodin 2020-04-09 16:45:14 +02:00
parent 1cb92daa77
commit d7327d4395

View File

@ -44,9 +44,7 @@ module.exports = {
_.defaults(jwtOptions, defaultJwtOptions);
return jwt.sign(
_.clone(payload.toJSON ? payload.toJSON() : payload),
process.env.JWT_SECRET ||
_.get(strapi.plugins['users-permissions'], 'config.jwtSecret') ||
'oursecret',
_.get(strapi.plugins, ['users-permissions', 'config', 'jwtSecret']),
jwtOptions
);
},
@ -55,9 +53,7 @@ module.exports = {
return new Promise(function(resolve, reject) {
jwt.verify(
token,
process.env.JWT_SECRET ||
_.get(strapi.plugins['users-permissions'], 'config.jwtSecret') ||
'oursecret',
_.get(strapi.plugins, ['users-permissions', 'config', 'jwtSecret']),
{},
function(err, tokenPayload = {}) {
if (err) {