qumra-engine 2.0.84 → 2.0.86

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.
@@ -30,6 +30,7 @@ const prepareDataMiddleware = (req, res, next) => {
30
30
  params.set("themeWidget", String(res.locals.themeWidget));
31
31
  }
32
32
  themePath = params.toString() ? `?${params.toString()}` : "";
33
+ console.log("🚀 ~ prepareDataMiddleware ~ themePath:", themePath);
33
34
  let api = "";
34
35
  if (res.locals.preview && res.locals.themeWidget) {
35
36
  api = `${res.locals.renderApi}/render/preview-widget${themePath}`;
@@ -41,16 +41,17 @@ const startEngine = async ({ renderApi, mode, getRender, setRender, port = 3000,
41
41
  next();
42
42
  });
43
43
  app.set("trust proxy", 1); // لو ورا Nginx/Proxy/Cloud
44
+ const isProduction = process.env.NODE_ENV === "production";
44
45
  app.use((0, express_session_1.default)({
45
- secret: "your-secret-key",
46
+ secret: process.env.SESSION_SECRET || "your-secret-key",
46
47
  resave: false,
47
48
  saveUninitialized: false,
48
49
  cookie: {
49
- sameSite: "none", // مطلوب للـ cross-site
50
- secure: true, // لازم مع 'none'
50
+ sameSite: "none", // يدعم داخل وخارج iframe
51
+ secure: isProduction, // لازم يكون true في production مع HTTPS
51
52
  httpOnly: true,
52
- partitioned: true, // علشان تشتغل داخل iframe بعد حجب 3rd-party cookies
53
- maxAge: 1000 * 60 * 5,
53
+ partitioned: true, // يخليها شغالة في iframe (Chrome 115+)
54
+ maxAge: 1000 * 60 * 5, // 5 دقائق
54
55
  },
55
56
  }));
56
57
  app.use((req, res, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "2.0.84",
3
+ "version": "2.0.86",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {