ngx-techlify-core 11.4.5-beta.2 → 11.4.5-beta.6

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.
@@ -742,26 +742,37 @@
742
742
  */
743
743
  var TechlifyConfig = /** @class */ (function () {
744
744
  function TechlifyConfig(data) {
745
+ this.data = data;
745
746
  this.projectKey = '';
746
747
  this.environment = '';
747
748
  this.authClientSecret = '';
748
749
  this.authGrantType = '';
749
750
  this.apiUrl = '';
750
751
  this.isLogoutWhileApiGetsFailed = false;
751
- this.loadFromMap(data);
752
- }
753
- TechlifyConfig.prototype.loadFromMap = function (data) {
754
- this.projectKey = data.projectKey;
755
- this.environment = data.environment;
756
- this.authClientSecret = data.authClientSecret;
757
- this.authGrantType = data.authGrantType;
758
- this.apiUrl = data.apiUrl;
759
- this.storage = data === null || data === void 0 ? void 0 : data.storage;
760
- this.rawConfigs = data;
761
- this.isLogoutWhileApiGetsFailed = data === null || data === void 0 ? void 0 : data.isLogoutWhileApiGetsFailed;
752
+ this.loadFromMap();
753
+ }
754
+ TechlifyConfig.prototype.loadFromMap = function () {
755
+ var _a, _b;
756
+ this.projectKey = this.data.projectKey;
757
+ this.environment = this.data.environment;
758
+ this.authClientSecret = this.data.authClientSecret;
759
+ this.authGrantType = this.data.authGrantType;
760
+ this.apiUrl = this.data.apiUrl;
761
+ this.storage = (_a = this.data) === null || _a === void 0 ? void 0 : _a.storage;
762
+ this.rawConfigs = this.data;
763
+ this.isLogoutWhileApiGetsFailed = (_b = this.data) === null || _b === void 0 ? void 0 : _b.isLogoutWhileApiGetsFailed;
762
764
  };
763
765
  return TechlifyConfig;
764
766
  }());
767
+ TechlifyConfig.ɵprov = i0.ɵɵdefineInjectable({ factory: function TechlifyConfig_Factory() { return new TechlifyConfig(i0.ɵɵinject("data")); }, token: TechlifyConfig, providedIn: "root" });
768
+ TechlifyConfig.decorators = [
769
+ { type: i0.Injectable, args: [{
770
+ providedIn: 'root'
771
+ },] }
772
+ ];
773
+ TechlifyConfig.ctorParameters = function () { return [
774
+ { type: undefined, decorators: [{ type: i0.Inject, args: ['data',] }] }
775
+ ]; };
765
776
 
766
777
  /**
767
778
  * Service that provides settings for all other services
@@ -884,9 +895,8 @@
884
895
  * @since 20171202
885
896
  */
886
897
  var ErrorHandlerService = /** @class */ (function () {
887
- function ErrorHandlerService(alerter, config) {
898
+ function ErrorHandlerService(alerter) {
888
899
  this.alerter = alerter;
889
- this.config = config;
890
900
  }
891
901
  ErrorHandlerService.prototype.handleError = function (errorResponse, msg) {
892
902
  if (msg === void 0) { msg = ''; }
@@ -914,23 +924,17 @@
914
924
  }
915
925
  var errMessage = errors.length ? errors[0] : msg;
916
926
  this.alerter.addAlert("Error: " + errMessage, "warning");
917
- if (errorResponse.status == 403 && this.config.isLogoutWhileApiGetsFailed) {
918
- sessionStorage.clear();
919
- localStorage.clear();
920
- location.reload();
921
- }
922
927
  };
923
928
  return ErrorHandlerService;
924
929
  }());
925
- ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService), i0.ɵɵinject(TechlifyConfig)); }, token: ErrorHandlerService, providedIn: "root" });
930
+ ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
926
931
  ErrorHandlerService.decorators = [
927
932
  { type: i0.Injectable, args: [{
928
933
  providedIn: 'root'
929
934
  },] }
930
935
  ];
931
936
  ErrorHandlerService.ctorParameters = function () { return [
932
- { type: AlertService },
933
- { type: TechlifyConfig }
937
+ { type: AlertService }
934
938
  ]; };
935
939
 
936
940
  var log = new Logger('ErrorHandlerInterceptor');