@como/como-client 0.7.1 → 0.7.2
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/como.js +11 -9
- package/lib/services/auth.service.js +6 -3
- package/package.json +1 -1
- package/src/como.js +1 -1
package/lib/como.js
CHANGED
|
@@ -262,36 +262,38 @@ var Como = function () {
|
|
|
262
262
|
break;
|
|
263
263
|
|
|
264
264
|
case 49:
|
|
265
|
-
_context2.next =
|
|
265
|
+
_context2.next = 60;
|
|
266
266
|
break;
|
|
267
267
|
|
|
268
268
|
case 51:
|
|
269
269
|
_context2.prev = 51;
|
|
270
|
-
|
|
270
|
+
|
|
271
|
+
console.error('signOn with, installationId:' + installationId + ', locationId:' + locationId + ', source:' + source + ',accessToken:' + accessToken);
|
|
272
|
+
_context2.next = 55;
|
|
271
273
|
return this.comoData.initApi.signOn(installationId, locationId, source, accessToken);
|
|
272
274
|
|
|
273
|
-
case
|
|
274
|
-
_context2.next =
|
|
275
|
+
case 55:
|
|
276
|
+
_context2.next = 60;
|
|
275
277
|
break;
|
|
276
278
|
|
|
277
|
-
case
|
|
278
|
-
_context2.prev =
|
|
279
|
+
case 57:
|
|
280
|
+
_context2.prev = 57;
|
|
279
281
|
_context2.t2 = _context2['catch'](51);
|
|
280
282
|
|
|
281
283
|
console.log('Failed signOn with accessToken, installationId:' + installationId + ', locationId:' + locationId + ', source:' + source + ',accessToken:' + accessToken + ', error:' + _context2.t2);
|
|
282
284
|
|
|
283
|
-
case
|
|
285
|
+
case 60:
|
|
284
286
|
if (!this.comoData.token) {
|
|
285
287
|
this.comoData.token = this.comoData.accessToken;
|
|
286
288
|
}
|
|
287
289
|
return _context2.abrupt('return', this.getCredentials());
|
|
288
290
|
|
|
289
|
-
case
|
|
291
|
+
case 62:
|
|
290
292
|
case 'end':
|
|
291
293
|
return _context2.stop();
|
|
292
294
|
}
|
|
293
295
|
}
|
|
294
|
-
}, _callee2, this, [[17, 24], [32, 40], [51,
|
|
296
|
+
}, _callee2, this, [[17, 24], [32, 40], [51, 57]]);
|
|
295
297
|
}));
|
|
296
298
|
|
|
297
299
|
function init(_x, _x2, _x3) {
|
|
@@ -40,15 +40,18 @@ exports.signOn = function (service) {
|
|
|
40
40
|
if (accessToken) {
|
|
41
41
|
headers['Authorization'] = "Bearer " + token;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
console.error("signOn(auth) with deviceId:" + deviceId + ", locationId:" + locationId + ", source:" + source + ",accessToken:" + accessToken + ", headers: " + headers);
|
|
44
|
+
_context.next = 6;
|
|
44
45
|
return service.post('/auth/v2/auth/signOn', params, { headers: headers });
|
|
45
46
|
|
|
46
|
-
case
|
|
47
|
+
case 6:
|
|
47
48
|
_ref2 = _context.sent;
|
|
48
49
|
data = _ref2.data;
|
|
50
|
+
|
|
51
|
+
console.error("signOn(auth) result with data:" + data);
|
|
49
52
|
return _context.abrupt("return", data);
|
|
50
53
|
|
|
51
|
-
case
|
|
54
|
+
case 10:
|
|
52
55
|
case "end":
|
|
53
56
|
return _context.stop();
|
|
54
57
|
}
|
package/package.json
CHANGED
package/src/como.js
CHANGED
|
@@ -132,10 +132,10 @@ class Como {
|
|
|
132
132
|
}
|
|
133
133
|
else{
|
|
134
134
|
try{
|
|
135
|
+
console.error(`signOn with, installationId:${installationId}, locationId:${locationId}, source:${source},accessToken:${accessToken}`);
|
|
135
136
|
await this.comoData.initApi.signOn(installationId, locationId, source, accessToken);
|
|
136
137
|
}catch(e){
|
|
137
138
|
console.log(`Failed signOn with accessToken, installationId:${installationId}, locationId:${locationId}, source:${source},accessToken:${accessToken}, error:${e}`);
|
|
138
|
-
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
}
|