@vulkano/core 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bootstrap/server.js +8 -2
- package/package.json +1 -1
package/bootstrap/server.js
CHANGED
|
@@ -150,9 +150,9 @@ module.exports = {
|
|
|
150
150
|
// COOKIES - File: app/config/express/cookies.js
|
|
151
151
|
// ---------------
|
|
152
152
|
if (expressConfig.cookies && expressConfig.cookies.enabled) {
|
|
153
|
-
const cookiesSecretKey =
|
|
153
|
+
const cookiesSecretKey = process.env.COOKIES_SECRET_KEY || expressConfig.cookies.key || expressConfig.cookies.secret || '';
|
|
154
154
|
if (!cookiesSecretKey) {
|
|
155
|
-
console.log('
|
|
155
|
+
console.log(' \x1b[33mWARNING\x1b[0m: Set the secret key in the config/express/cookie.js file or COOKIES_SECRET_KEY in the .env file.');
|
|
156
156
|
}
|
|
157
157
|
server.use(cookieParser(cookiesSecretKey));
|
|
158
158
|
}
|
|
@@ -265,6 +265,12 @@ module.exports = {
|
|
|
265
265
|
// ---------------
|
|
266
266
|
if (expressConfig.jwt && expressConfig.jwt.enabled) {
|
|
267
267
|
|
|
268
|
+
const jwtSecretKey = process.env.JWT_SECRET_KEY || expressConfig.jwt.key || expressConfig.jwt.secret || '';
|
|
269
|
+
if (!jwtSecretKey) {
|
|
270
|
+
console.log(' \x1b[41mERROR\x1b[0m: Can not get key in config/express/jwt.js file or JWT_SECRET_KEY in .env file');
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
|
|
268
274
|
// JWT (secret key)
|
|
269
275
|
server.use(expressConfig.jwt.path || '*', jwtMiddleware.init().unless({
|
|
270
276
|
path: expressConfig.jwt.ignore || []
|