rest-client-sdk 7.1.0 → 7.1.1

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/dist/index.es.js CHANGED
@@ -1299,6 +1299,10 @@ var AbstractClient = /*#__PURE__*/function () {
1299
1299
  if (accessTokenExpiresIn !== null && accessTokenExpiresIn <= EXPIRE_LIMIT_SECONDS) {
1300
1300
  return _classPrivateFieldGet(_this3, _tokenStorage).refreshToken().then(function (refreshedTokenObject) {
1301
1301
  return refreshedTokenObject.access_token;
1302
+ })["catch"](function (e) {
1303
+ _this3._handleRefreshTokenFailure(e);
1304
+
1305
+ throw e;
1302
1306
  });
1303
1307
  }
1304
1308
 
@@ -1327,13 +1331,7 @@ var AbstractClient = /*#__PURE__*/function () {
1327
1331
 
1328
1332
  return _this4._fetchWithToken(input, updatedRequestParams);
1329
1333
  })["catch"](function (e) {
1330
- if (e instanceof OauthError) {
1331
- _classPrivateFieldGet(_this4, _tokenStorage).logout().then(function () {
1332
- if (_this4.sdk.config.onRefreshTokenFailure) {
1333
- _this4.sdk.config.onRefreshTokenFailure(e);
1334
- }
1335
- });
1336
- }
1334
+ _this4._handleRefreshTokenFailure(e);
1337
1335
 
1338
1336
  throw e;
1339
1337
  });
@@ -1441,6 +1439,19 @@ var AbstractClient = /*#__PURE__*/function () {
1441
1439
 
1442
1440
  return object[idKey];
1443
1441
  }
1442
+ }, {
1443
+ key: "_handleRefreshTokenFailure",
1444
+ value: function _handleRefreshTokenFailure(error) {
1445
+ var _this7 = this;
1446
+
1447
+ if (error instanceof OauthError) {
1448
+ _classPrivateFieldGet(this, _tokenStorage).logout().then(function () {
1449
+ if (_this7.sdk.config.onRefreshTokenFailure) {
1450
+ _this7.sdk.config.onRefreshTokenFailure(error);
1451
+ }
1452
+ });
1453
+ }
1454
+ }
1444
1455
  }]);
1445
1456
 
1446
1457
  return AbstractClient;