@vendit-dev/thirdparty-adapters 0.3.28 → 0.3.29
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/lib/adapters/themrIoT.js +6 -1
- package/package.json +1 -1
package/lib/adapters/themrIoT.js
CHANGED
|
@@ -114,6 +114,7 @@ var ThemrIoTAdapter = /** @class */ (function () {
|
|
|
114
114
|
case 0: return [4 /*yield*/, this.redis.get(ThemrIoTAdapter.indexAccommodation({ accommodationId: accommodationId }))];
|
|
115
115
|
case 1:
|
|
116
116
|
existingAuth = _b.sent();
|
|
117
|
+
console.log('AUTH 1', existingAuth);
|
|
117
118
|
if (existingAuth) {
|
|
118
119
|
if (existingAuth === 'NOT_FOUND') {
|
|
119
120
|
return [2 /*return*/, false];
|
|
@@ -127,10 +128,12 @@ var ThemrIoTAdapter = /** @class */ (function () {
|
|
|
127
128
|
return [4 /*yield*/, this.redis.get(ThemrIoTAdapter.indexAccommodation({ accommodationId: accommodationId }))];
|
|
128
129
|
case 3:
|
|
129
130
|
existingAuth = _b.sent();
|
|
131
|
+
console.log('AUTH 2', existingAuth);
|
|
130
132
|
_b.label = 4;
|
|
131
133
|
case 4:
|
|
132
134
|
_b.trys.push([4, 9, 10, 12]);
|
|
133
135
|
if (existingAuth) {
|
|
136
|
+
console.log('AUTH 3', this.parseJSONSafe(existingAuth));
|
|
134
137
|
return [2 /*return*/, this.parseJSONSafe(existingAuth)];
|
|
135
138
|
}
|
|
136
139
|
return [4 /*yield*/, this.authenticator.getThirdPartyCredential({
|
|
@@ -139,6 +142,7 @@ var ThemrIoTAdapter = /** @class */ (function () {
|
|
|
139
142
|
})];
|
|
140
143
|
case 5:
|
|
141
144
|
newAuth = _b.sent();
|
|
145
|
+
console.log('AUTH 4', newAuth);
|
|
142
146
|
if (!(!newAuth || !(newAuth === null || newAuth === void 0 ? void 0 : newAuth.credential))) return [3 /*break*/, 7];
|
|
143
147
|
return [4 /*yield*/, this.redis.set(ThemrIoTAdapter.indexAccommodation({ accommodationId: accommodationId }), 'NOT_FOUND', 'EX', 60 * 10)];
|
|
144
148
|
case 6:
|
|
@@ -146,7 +150,8 @@ var ThemrIoTAdapter = /** @class */ (function () {
|
|
|
146
150
|
return [2 /*return*/, false];
|
|
147
151
|
case 7:
|
|
148
152
|
parsedCredential = this.parseJSONSafe(newAuth.credential);
|
|
149
|
-
|
|
153
|
+
console.log('AUTH 4', parsedCredential);
|
|
154
|
+
return [4 /*yield*/, this.redis.set(ThemrIoTAdapter.indexAccommodation({ accommodationId: accommodationId }), newAuth.credential, 'EX', 60 * 10)];
|
|
150
155
|
case 8:
|
|
151
156
|
_b.sent();
|
|
152
157
|
return [2 /*return*/, parsedCredential];
|