biz-slide-core 1.2.47 → 1.2.48

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,8 @@ var PPTSchema = new mongoose_1.Schema({
25
25
  addtionalInfoUrl: { type: String, default: null },
26
26
  info: { type: String, default: null },
27
27
  prompt: { type: String, default: null },
28
- noOfSlides: { type: Number, default: null }
28
+ noOfSlides: { type: Number, default: null },
29
+ appName: { type: String, default: null },
29
30
  }, {
30
31
  timestamps: true,
31
32
  });
@@ -106,10 +106,12 @@ var authorizeWithSlideApp = function () {
106
106
  return function (req, res, next) {
107
107
  var _a;
108
108
  return __awaiter(this, void 0, void 0, function () {
109
- var token, userId;
109
+ var ipAddress, sessionId, token, userId;
110
110
  return __generator(this, function (_b) {
111
111
  switch (_b.label) {
112
112
  case 0:
113
+ ipAddress = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
114
+ sessionId = req.headers['x-fingerprint-key'];
113
115
  if (!req.headers.authorization) {
114
116
  return [2 /*return*/, res.status(401).json({ message: 'Unauthorized' })];
115
117
  }
@@ -125,7 +127,10 @@ var authorizeWithSlideApp = function () {
125
127
  return [2 /*return*/, res.status(401).json({ message: 'userId not found' })];
126
128
  }
127
129
  req.user = {
128
- userId: userId
130
+ userId: userId,
131
+ sessionId: sessionId,
132
+ ipAddress: ipAddress,
133
+ appName: req.headers['x-app-name']
129
134
  };
130
135
  next();
131
136
  _b.label = 2;
@@ -168,7 +173,8 @@ var nonAuthorizeWithSlideApp = function () {
168
173
  req.user = {
169
174
  userId: userId,
170
175
  sessionId: sessionId,
171
- ipAddress: ipAddress
176
+ ipAddress: ipAddress,
177
+ appName: req.headers['x-app-name']
172
178
  };
173
179
  next();
174
180
  return [2 /*return*/];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz-slide-core",
3
- "version": "1.2.47",
3
+ "version": "1.2.48",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {