@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.
@@ -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 = expressConfig.cookies && expressConfig.cookies.secret ? expressConfig.cookies.secret : '';
153
+ const cookiesSecretKey = process.env.COOKIES_SECRET_KEY || expressConfig.cookies.key || expressConfig.cookies.secret || '';
154
154
  if (!cookiesSecretKey) {
155
- console.log('Warning: Please set cookie secret key in the file config/express/cookie.js');
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 || []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulkano/core",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "A MVC framework using Express 4",
5
5
  "license": "MIT",
6
6
  "author": "Vulkano Team",