biz-slide-core 1.2.74 → 1.2.75

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.
@@ -130,7 +130,8 @@ var authorizeWithSlideApp = function () {
130
130
  userId: userId,
131
131
  sessionId: sessionId,
132
132
  ipAddress: ipAddress,
133
- appName: req.headers['x-app-name']
133
+ appName: req.headers['x-app-name'],
134
+ email: (token === null || token === void 0 ? void 0 : token.customer_id) || ""
134
135
  };
135
136
  next();
136
137
  _b.label = 2;
@@ -145,13 +146,14 @@ var nonAuthorizeWithSlideApp = function () {
145
146
  return function (req, res, next) {
146
147
  var _a;
147
148
  return __awaiter(this, void 0, void 0, function () {
148
- var ipAddress, sessionId, userId, token;
149
+ var ipAddress, sessionId, userId, email, token;
149
150
  return __generator(this, function (_b) {
150
151
  switch (_b.label) {
151
152
  case 0:
152
153
  ipAddress = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
153
154
  sessionId = req.headers['x-fingerprint-key'];
154
155
  userId = "guest";
156
+ email = "";
155
157
  if (!req.headers.authorization) return [3 /*break*/, 2];
156
158
  return [4 /*yield*/, (0, utilities_1.verifyUid)(req.headers.authorization)];
157
159
  case 1:
@@ -160,6 +162,7 @@ var nonAuthorizeWithSlideApp = function () {
160
162
  return [2 /*return*/, res.status(401).json({ message: 'Session Expired' })];
161
163
  }
162
164
  userId = (token === null || token === void 0 ? void 0 : token.customer_id) || ((_a = token === null || token === void 0 ? void 0 : token.value) === null || _a === void 0 ? void 0 : _a.email);
165
+ email = (token === null || token === void 0 ? void 0 : token.customer_id) || "";
163
166
  if (!userId) {
164
167
  return [2 /*return*/, res.status(401).json({ message: 'userId not found' })];
165
168
  }
@@ -174,7 +177,8 @@ var nonAuthorizeWithSlideApp = function () {
174
177
  userId: userId,
175
178
  sessionId: sessionId,
176
179
  ipAddress: ipAddress,
177
- appName: req.headers['x-app-name']
180
+ appName: req.headers['x-app-name'],
181
+ email: email
178
182
  };
179
183
  next();
180
184
  return [2 /*return*/];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz-slide-core",
3
- "version": "1.2.74",
3
+ "version": "1.2.75",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {