monkey-front-core 0.0.214 → 0.0.217

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.
@@ -4709,7 +4709,7 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
4709
4709
  this.config = config;
4710
4710
  // not to do
4711
4711
  }
4712
- async handle(request, next) {
4712
+ async handle(request) {
4713
4713
  const { url } = request;
4714
4714
  if (this.authService.isTokenMandatory(url)) {
4715
4715
  try {
@@ -4724,10 +4724,20 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
4724
4724
  // not to do
4725
4725
  }
4726
4726
  }
4727
- return this.authService
4728
- .getRequestWithHeadersOb(request)
4727
+ const resp = await this.authService
4728
+ .getRequestWithHeaders(request)
4729
4729
  .pipe(take(1), map((event) => {
4730
4730
  return event;
4731
+ }), catchError((error) => {
4732
+ this.errorHandlingService.handleError(error);
4733
+ return throwError(error);
4734
+ }))
4735
+ .toPromise();
4736
+ return resp;
4737
+ }
4738
+ intercept(request, next) {
4739
+ return from(this.handle(request)).pipe(take(1), map((event) => {
4740
+ return event;
4731
4741
  }), mergeMap((resp) => {
4732
4742
  request = request.clone({
4733
4743
  setHeaders: resp
@@ -4736,11 +4746,7 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
4736
4746
  }), catchError((error) => {
4737
4747
  this.errorHandlingService.handleError(error);
4738
4748
  return throwError(error);
4739
- }))
4740
- .toPromise();
4741
- }
4742
- intercept(request, next) {
4743
- return from(this.handle(request, next));
4749
+ }));
4744
4750
  }
4745
4751
  }
4746
4752
  MonkeyEcxHttpConfigHeaderInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }, { token: MonkeyEcxConfigService }], target: i0.ɵɵFactoryTarget.Injectable });