mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 23:29:33 +00:00
remove overwritting env var witohut passing by the config
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
1cb92daa77
commit
d7327d4395
@ -44,9 +44,7 @@ module.exports = {
|
|||||||
_.defaults(jwtOptions, defaultJwtOptions);
|
_.defaults(jwtOptions, defaultJwtOptions);
|
||||||
return jwt.sign(
|
return jwt.sign(
|
||||||
_.clone(payload.toJSON ? payload.toJSON() : payload),
|
_.clone(payload.toJSON ? payload.toJSON() : payload),
|
||||||
process.env.JWT_SECRET ||
|
_.get(strapi.plugins, ['users-permissions', 'config', 'jwtSecret']),
|
||||||
_.get(strapi.plugins['users-permissions'], 'config.jwtSecret') ||
|
|
||||||
'oursecret',
|
|
||||||
jwtOptions
|
jwtOptions
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -55,9 +53,7 @@ module.exports = {
|
|||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
jwt.verify(
|
jwt.verify(
|
||||||
token,
|
token,
|
||||||
process.env.JWT_SECRET ||
|
_.get(strapi.plugins, ['users-permissions', 'config', 'jwtSecret']),
|
||||||
_.get(strapi.plugins['users-permissions'], 'config.jwtSecret') ||
|
|
||||||
'oursecret',
|
|
||||||
{},
|
{},
|
||||||
function(err, tokenPayload = {}) {
|
function(err, tokenPayload = {}) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user