@vasrefil/api-toolkit 1.8.5 → 1.9.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/dist/index.js CHANGED
@@ -14,6 +14,7 @@ const logger_util_1 = require("./utilities/logger.util");
14
14
  // import { airbrake, airbrakeExpress } from './app-middlewares/airbrake';
15
15
  const port = process.env.PORT || 8012;
16
16
  const app = (0, express_1.default)();
17
+ app.set('trust proxy', true);
17
18
  //configure application
18
19
  app.use(express_1.default.static(path_1.default.join(__dirname, "public")));
19
20
  //mount json form parser
@@ -100,6 +100,9 @@ class LogUtil_ {
100
100
  // if(this.cronjobs_events.includes(actionType)) {
101
101
  // distinct_id = 'cron-job.org';
102
102
  // }
103
+ if (req.user_token_data) {
104
+ distinct_id = req.user_token_data.email;
105
+ }
103
106
  if (actionType.toLowerCase().includes('webhook')) {
104
107
  distinct_id = actionType.toLowerCase();
105
108
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vasrefil/api-toolkit",
3
3
  "description": "This is Vasrefil API toolkit",
4
- "version": "1.8.5",
4
+ "version": "1.9.0",
5
5
  "author": "Sodiq Alabi",
6
6
  "main": "dist/public-api.js",
7
7
  "types": "dist/public-api.d.ts",