notherbase-fs 4.0.21 → 4.0.22
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/notherbase-fs.js +2 -1
- package/package.json +1 -1
package/notherbase-fs.js
CHANGED
|
@@ -11,7 +11,6 @@ import SpiritWorld from "./controllers/spirit-world.js";
|
|
|
11
11
|
import favicon from 'serve-favicon';
|
|
12
12
|
import session from 'express-session';
|
|
13
13
|
import MongoStore from 'connect-mongo';
|
|
14
|
-
import cors from 'cors';
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
/**
|
|
@@ -92,6 +91,8 @@ class NotherBaseFS {
|
|
|
92
91
|
req.globals = globals;
|
|
93
92
|
req.db = Models;
|
|
94
93
|
req.lock = false;
|
|
94
|
+
// enables sessions only if the protocol is https and we are in production, or if we are in development
|
|
95
|
+
req.sessionsEnabled = (process.env.PRODUCTION == "true" && req.secure) || process.env.PRODUCTION == "false";
|
|
95
96
|
next();
|
|
96
97
|
});
|
|
97
98
|
|