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 +18 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/types/client/AbstractClient.d.ts +1 -0
- package/package.json +1 -1
- package/src/client/AbstractClient.ts +16 -8
package/dist/index.js
CHANGED
|
@@ -1305,6 +1305,10 @@
|
|
|
1305
1305
|
if (accessTokenExpiresIn !== null && accessTokenExpiresIn <= EXPIRE_LIMIT_SECONDS) {
|
|
1306
1306
|
return _classPrivateFieldGet(_this3, _tokenStorage).refreshToken().then(function (refreshedTokenObject) {
|
|
1307
1307
|
return refreshedTokenObject.access_token;
|
|
1308
|
+
})["catch"](function (e) {
|
|
1309
|
+
_this3._handleRefreshTokenFailure(e);
|
|
1310
|
+
|
|
1311
|
+
throw e;
|
|
1308
1312
|
});
|
|
1309
1313
|
}
|
|
1310
1314
|
|
|
@@ -1333,13 +1337,7 @@
|
|
|
1333
1337
|
|
|
1334
1338
|
return _this4._fetchWithToken(input, updatedRequestParams);
|
|
1335
1339
|
})["catch"](function (e) {
|
|
1336
|
-
|
|
1337
|
-
_classPrivateFieldGet(_this4, _tokenStorage).logout().then(function () {
|
|
1338
|
-
if (_this4.sdk.config.onRefreshTokenFailure) {
|
|
1339
|
-
_this4.sdk.config.onRefreshTokenFailure(e);
|
|
1340
|
-
}
|
|
1341
|
-
});
|
|
1342
|
-
}
|
|
1340
|
+
_this4._handleRefreshTokenFailure(e);
|
|
1343
1341
|
|
|
1344
1342
|
throw e;
|
|
1345
1343
|
});
|
|
@@ -1447,6 +1445,19 @@
|
|
|
1447
1445
|
|
|
1448
1446
|
return object[idKey];
|
|
1449
1447
|
}
|
|
1448
|
+
}, {
|
|
1449
|
+
key: "_handleRefreshTokenFailure",
|
|
1450
|
+
value: function _handleRefreshTokenFailure(error) {
|
|
1451
|
+
var _this7 = this;
|
|
1452
|
+
|
|
1453
|
+
if (error instanceof OauthError) {
|
|
1454
|
+
_classPrivateFieldGet(this, _tokenStorage).logout().then(function () {
|
|
1455
|
+
if (_this7.sdk.config.onRefreshTokenFailure) {
|
|
1456
|
+
_this7.sdk.config.onRefreshTokenFailure(error);
|
|
1457
|
+
}
|
|
1458
|
+
});
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1450
1461
|
}]);
|
|
1451
1462
|
|
|
1452
1463
|
return AbstractClient;
|