biz-slide-core 1.2.52 → 1.2.54

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.
@@ -28,6 +28,7 @@ var PPTSchema = new mongoose_1.Schema({
28
28
  noOfSlides: { type: Number, default: null },
29
29
  appName: { type: String, default: null },
30
30
  navigateFromGPT: { type: Boolean, default: false },
31
+ googleDriveId: { type: String, default: null }
31
32
  }, {
32
33
  timestamps: true,
33
34
  });
@@ -187,10 +187,11 @@ exports.nonAuthorizeWithSlideApp = nonAuthorizeWithSlideApp;
187
187
  var authorizeWithGpt = function () {
188
188
  return function (req, res, next) {
189
189
  return __awaiter(this, void 0, void 0, function () {
190
- var secret, ipAddress, userId;
190
+ var secret, secretKey, ipAddress, userId;
191
191
  return __generator(this, function (_a) {
192
192
  secret = req.headers['authorization'];
193
- if (!secret || secret !== "Bearer ".concat(process.env.GPT_API_KEY)) {
193
+ secretKey = secret ? secret.split(":") : undefined;
194
+ if (secretKey && secretKey.length === 2 && secretKey[0] !== "Bearer ".concat(process.env.GPT_API_KEY)) {
194
195
  return [2 /*return*/, res.status(401).json({ message: 'keys not matching' })];
195
196
  }
196
197
  ipAddress = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
@@ -198,7 +199,7 @@ var authorizeWithGpt = function () {
198
199
  req.user = {
199
200
  userId: userId,
200
201
  ipAddress: ipAddress,
201
- appName: req.headers['x-app-name'],
202
+ appName: secretKey[1],
202
203
  navigateFromGPT: true
203
204
  };
204
205
  next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz-slide-core",
3
- "version": "1.2.52",
3
+ "version": "1.2.54",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {