@como/como-client 0.7.84 → 0.7.85

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.
Files changed (3) hide show
  1. package/lib/como.js +14 -11
  2. package/package.json +1 -1
  3. package/src/como.js +3 -0
package/lib/como.js CHANGED
@@ -268,12 +268,12 @@ var Como = function () {
268
268
  break;
269
269
 
270
270
  case 49:
271
- _context2.next = 73;
271
+ _context2.next = 74;
272
272
  break;
273
273
 
274
274
  case 51:
275
275
  if (isExpired) {
276
- _context2.next = 73;
276
+ _context2.next = 74;
277
277
  break;
278
278
  }
279
279
 
@@ -281,7 +281,7 @@ var Como = function () {
281
281
 
282
282
  case 53:
283
283
  if (!(!signOnSuccessfully && interval < 3000)) {
284
- _context2.next = 73;
284
+ _context2.next = 74;
285
285
  break;
286
286
  }
287
287
 
@@ -299,38 +299,41 @@ var Como = function () {
299
299
  console.log('signOn- updating credentials');
300
300
  updateCredentials(_data2, true);
301
301
  }
302
+ if (_data2 && _data2.config && _data2.config.recaptchaSiteKey) {
303
+ this.comoData.reCaptchaSiteKey = _data2.config.recaptchaSiteKey;
304
+ }
302
305
  signOnSuccessfully = true;
303
- _context2.next = 71;
306
+ _context2.next = 72;
304
307
  break;
305
308
 
306
- case 64:
307
- _context2.prev = 64;
309
+ case 65:
310
+ _context2.prev = 65;
308
311
  _context2.t2 = _context2['catch'](54);
309
312
 
310
313
  console.error('Failed signOn with accessToken, installationId:' + installationId + ', locationId:' + locationId + ', source:' + source + ',accessToken:' + accessToken + ', error:' + _context2.t2.message);
311
314
  interval += 1000;
312
315
  initService.logError({ method: 'signOn with credentials', accessToken: accessToken, isExpired: isExpired, refreshFailed: refreshFailed, credExist: credExist, installationId: installationId, locationId: locationId, source: source, refreshToken: refreshToken, interval: interval, error: _context2.t2.message });
313
- _context2.next = 71;
316
+ _context2.next = 72;
314
317
  return new _promise2.default(function (r) {
315
318
  return setTimeout(r, interval);
316
319
  });
317
320
 
318
- case 71:
321
+ case 72:
319
322
  _context2.next = 53;
320
323
  break;
321
324
 
322
- case 73:
325
+ case 74:
323
326
  if (!this.comoData.token) {
324
327
  this.comoData.token = this.comoData.accessToken;
325
328
  }
326
329
  return _context2.abrupt('return', this.getCredentials());
327
330
 
328
- case 75:
331
+ case 76:
329
332
  case 'end':
330
333
  return _context2.stop();
331
334
  }
332
335
  }
333
- }, _callee2, this, [[17, 24], [32, 40], [54, 64]]);
336
+ }, _callee2, this, [[17, 24], [32, 40], [54, 65]]);
334
337
  }));
335
338
 
336
339
  function init(_x, _x2, _x3) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@como/como-client",
3
- "version": "0.7.84",
3
+ "version": "0.7.85",
4
4
  "description": "Client module for Como's loaylty API",
5
5
  "main": "src/como.js",
6
6
  "scripts": {
package/src/como.js CHANGED
@@ -143,6 +143,9 @@ class Como {
143
143
  console.log(`signOn- updating credentials`);
144
144
  updateCredentials(data, true);
145
145
  }
146
+ if(data && data.config && data.config.recaptchaSiteKey){
147
+ this.comoData.reCaptchaSiteKey = data.config.recaptchaSiteKey;
148
+ }
146
149
  signOnSuccessfully = true;
147
150
  }catch(e){
148
151
  console.error(`Failed signOn with accessToken, installationId:${installationId}, locationId:${locationId}, source:${source},accessToken:${accessToken}, error:${e.message}`);