ngx-techlify-core 11.4.5-beta.5 → 11.4.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.
@@ -884,8 +884,9 @@
884
884
  * @since 20171202
885
885
  */
886
886
  var ErrorHandlerService = /** @class */ (function () {
887
- function ErrorHandlerService(alerter) {
887
+ function ErrorHandlerService(alerter, config) {
888
888
  this.alerter = alerter;
889
+ this.config = config;
889
890
  }
890
891
  ErrorHandlerService.prototype.handleError = function (errorResponse, msg) {
891
892
  if (msg === void 0) { msg = ''; }
@@ -913,17 +914,23 @@
913
914
  }
914
915
  var errMessage = errors.length ? errors[0] : msg;
915
916
  this.alerter.addAlert("Error: " + errMessage, "warning");
917
+ if (errorResponse.status == 403 && this.config.isLogoutWhileApiGetsFailed) {
918
+ sessionStorage.clear();
919
+ localStorage.clear();
920
+ location.reload();
921
+ }
916
922
  };
917
923
  return ErrorHandlerService;
918
924
  }());
919
- ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
925
+ ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService), i0.ɵɵinject(TechlifyConfig)); }, token: ErrorHandlerService, providedIn: "root" });
920
926
  ErrorHandlerService.decorators = [
921
927
  { type: i0.Injectable, args: [{
922
928
  providedIn: 'root'
923
929
  },] }
924
930
  ];
925
931
  ErrorHandlerService.ctorParameters = function () { return [
926
- { type: AlertService }
932
+ { type: AlertService },
933
+ { type: TechlifyConfig }
927
934
  ]; };
928
935
 
929
936
  var log = new Logger('ErrorHandlerInterceptor');