@vendit-dev/thirdparty-adapters 0.3.24 → 0.3.25
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.
|
@@ -136,7 +136,8 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
136
136
|
console.log('AUTH 0', existingAuth);
|
|
137
137
|
if (existingAuth) {
|
|
138
138
|
if (existingAuth === 'NOT_FOUND') {
|
|
139
|
-
throw new Error('THIRDPARTY_AUTH_NOT_FOUND');
|
|
139
|
+
// throw new Error('THIRDPARTY_AUTH_NOT_FOUND');
|
|
140
|
+
return [2 /*return*/, false];
|
|
140
141
|
}
|
|
141
142
|
console.log('AUTH 1', existingAuth);
|
|
142
143
|
return [2 /*return*/, this.parseJSONSafe(existingAuth)];
|
|
@@ -164,15 +165,12 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
164
165
|
return [4 /*yield*/, this.redis.set(SmartAccessAdapter.indexAccommodation({ accommodationId: accommodationId }), 'NOT_FOUND', 'EX', 60 * 5)];
|
|
165
166
|
case 6:
|
|
166
167
|
_b.sent();
|
|
167
|
-
throw new Error('THIRDPARTY_AUTH_NOT_FOUND');
|
|
168
|
+
// throw new Error('THIRDPARTY_AUTH_NOT_FOUND');
|
|
169
|
+
return [2 /*return*/, false];
|
|
168
170
|
case 7:
|
|
169
171
|
console.log('AUTH 5', existingAuth);
|
|
170
|
-
if (!existingAuth && !newAuth.credential && !newAuth.scope) {
|
|
171
|
-
console.log('AUTH 6', existingAuth);
|
|
172
|
-
return [2 /*return*/, false];
|
|
173
|
-
}
|
|
174
172
|
parsedCredential = this.parseJSONSafe(newAuth.credential);
|
|
175
|
-
console.log('AUTH
|
|
173
|
+
console.log('AUTH 6', parsedCredential);
|
|
176
174
|
return [4 /*yield*/, this.redis.set(SmartAccessAdapter.indexAccommodation({ accommodationId: accommodationId }), newAuth.credential, 'EX', 60 * 5)];
|
|
177
175
|
case 8:
|
|
178
176
|
_b.sent();
|
|
@@ -197,6 +195,8 @@ var SmartAccessAdapter = /** @class */ (function () {
|
|
|
197
195
|
case 0: return [4 /*yield*/, this.getAccommodationAuthInfo({ accommodationId: accommodationId })];
|
|
198
196
|
case 1:
|
|
199
197
|
authInfo = _a.sent();
|
|
198
|
+
if (!(authInfo === null || authInfo === void 0 ? void 0 : authInfo.accessToken))
|
|
199
|
+
throw new Error('THIRDPARTH_AUTH_NOT_FOUND');
|
|
200
200
|
return [2 /*return*/, authInfo.accessToken];
|
|
201
201
|
}
|
|
202
202
|
});
|