@sambath999/localize-token 12.3.2 → 12.3.3

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.
@@ -638,6 +638,11 @@
638
638
  var base64 = btoa(JSON.stringify(value));
639
639
  LocalizeToken.storage.set(this.config.authTokenName, base64);
640
640
  };
641
+ LocalizeTokenService.prototype.tokensValid = function (tenantTokenName) {
642
+ var _a, _b;
643
+ return !!((_a = this.refreshToken) === null || _a === void 0 ? void 0 : _a.length)
644
+ && (!this.config.needTenant || !!((_b = this.tenantToken(tenantTokenName)) === null || _b === void 0 ? void 0 : _b.length));
645
+ };
641
646
  Object.defineProperty(LocalizeTokenService.prototype, "decodeRefreshToken", {
642
647
  get: function () {
643
648
  var token = LocalizeToken.storage.get(this.config.refreshTokenName);
@@ -888,6 +893,7 @@
888
893
  this.localizeTokenService = localizeTokenService;
889
894
  this.destroy$ = new rxjs.Subject();
890
895
  this.isRequestingSubject = new rxjs.BehaviorSubject(false);
896
+ this.isResolvedStartupSubject = new rxjs.BehaviorSubject(false);
891
897
  this.needTenant = LocalizeToken.config.needTenant;
892
898
  this.config = {
893
899
  waitEachRequest: { milliseconds: 0 },
@@ -914,6 +920,11 @@
914
920
  return _this.request(baseUrl, path, method, reqBody, reqHeaders);
915
921
  }; };
916
922
  }
923
+ Object.defineProperty(LocalizeApiService.prototype, "isResolvedStartup", {
924
+ get: function () { return this.isResolvedStartupSubject.value; },
925
+ enumerable: false,
926
+ configurable: true
927
+ });
917
928
  Object.defineProperty(LocalizeApiService.prototype, "isRequesting", {
918
929
  get: function () { return this.isRequestingSubject.value; },
919
930
  enumerable: false,
@@ -991,7 +1002,7 @@
991
1002
  return __generator(this, function (_b) {
992
1003
  switch (_b.label) {
993
1004
  case 0:
994
- if (error.status !== 401)
1005
+ if (error.status !== 401 || this.isResolvedStartup)
995
1006
  throw error;
996
1007
  return [4 /*yield*/, ApiHelper.performRetry({
997
1008
  maxRetries: function () { return 1000; },
@@ -1196,7 +1207,7 @@
1196
1207
  providers: [
1197
1208
  LocalizeTokenService,
1198
1209
  LocalizeApiService
1199
- ],
1210
+ ]
1200
1211
  },] }
1201
1212
  ];
1202
1213