monkey-front-core 0.0.370 → 0.0.372

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.
@@ -4434,7 +4434,8 @@ class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
4434
4434
  }, timeout);
4435
4435
  }
4436
4436
  handleErrorRefreshToken(error, mkc) {
4437
- if (error.status === 401 || error.status === 400) {
4437
+ const hasToRefresh = this.monkeyecxAuthenticationService.refreshShouldHappen(error);
4438
+ if ((error.status === 401 || error.status === 400) && hasToRefresh) {
4438
4439
  NgZone.call(this.monkeyecxAuthenticationService.redirectLoginWelcomeBack(), {});
4439
4440
  }
4440
4441
  else if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
@@ -5369,12 +5370,26 @@ class MonkeyEcxHttpConfigErrorInterceptor {
5369
5370
  // no to do
5370
5371
  }
5371
5372
  async handle(request, error) {
5372
- if (this.monkeyecxAuthenticationService.refreshShouldHappen(error)) {
5373
- await this.monkeyecxAuthenticationService?.refreshToken();
5374
- const headers = await this.monkeyecxAuthenticationService.getRequestWithHeadersAsync(request);
5375
- return headers;
5373
+ console.log('===@');
5374
+ console.log('error1');
5375
+ try {
5376
+ console.log('error2');
5377
+ if (this.monkeyecxAuthenticationService.refreshShouldHappen(error)) {
5378
+ console.log('error3');
5379
+ await this.monkeyecxAuthenticationService?.refreshToken();
5380
+ console.log('error4');
5381
+ const headers = await this.monkeyecxAuthenticationService.getRequestWithHeadersAsync(request);
5382
+ console.log('error5');
5383
+ console.log(headers);
5384
+ return headers;
5385
+ }
5386
+ }
5387
+ catch (e) {
5388
+ console.log('error6');
5389
+ console.log(e);
5390
+ return throwError(e);
5376
5391
  }
5377
- return throwError(null);
5392
+ return null;
5378
5393
  }
5379
5394
  intercept(request, next) {
5380
5395
  return next.handle(request).pipe(map((event) => {