monkey-front-core 0.0.369 → 0.0.371
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.
- package/esm2020/lib/core/interceptors/monkeyecx-http-config-error.interceptor.mjs +20 -6
- package/esm2020/lib/core/interceptors/monkeyecx-http-config-header.interceptor.mjs +15 -22
- package/esm2020/lib/core/services/error/monkeyecx-error-handling.service.mjs +4 -4
- package/fesm2015/monkey-front-core.mjs +32 -25
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +32 -25
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/error/monkeyecx-error-handling.service.d.ts +1 -1
- package/monkey-front-core-0.0.371.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.369.tgz +0 -0
|
@@ -5369,12 +5369,26 @@ class MonkeyEcxHttpConfigErrorInterceptor {
|
|
|
5369
5369
|
// no to do
|
|
5370
5370
|
}
|
|
5371
5371
|
async handle(request, error) {
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5372
|
+
console.log('===@');
|
|
5373
|
+
console.log('error1');
|
|
5374
|
+
try {
|
|
5375
|
+
console.log('error2');
|
|
5376
|
+
if (this.monkeyecxAuthenticationService.refreshShouldHappen(error)) {
|
|
5377
|
+
console.log('error3');
|
|
5378
|
+
await this.monkeyecxAuthenticationService?.refreshToken();
|
|
5379
|
+
console.log('error4');
|
|
5380
|
+
const headers = await this.monkeyecxAuthenticationService.getRequestWithHeadersAsync(request);
|
|
5381
|
+
console.log('error5');
|
|
5382
|
+
console.log(headers);
|
|
5383
|
+
return headers;
|
|
5384
|
+
}
|
|
5385
|
+
}
|
|
5386
|
+
catch (e) {
|
|
5387
|
+
console.log('error6');
|
|
5388
|
+
console.log(e);
|
|
5389
|
+
return throwError(e);
|
|
5376
5390
|
}
|
|
5377
|
-
return
|
|
5391
|
+
return null;
|
|
5378
5392
|
}
|
|
5379
5393
|
intercept(request, next) {
|
|
5380
5394
|
return next.handle(request).pipe(map((event) => {
|
|
@@ -5409,29 +5423,22 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
|
|
|
5409
5423
|
}
|
|
5410
5424
|
async handle(request) {
|
|
5411
5425
|
const { url } = request;
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
// not to do
|
|
5426
|
-
}
|
|
5427
|
-
} */
|
|
5426
|
+
if (this.authService.isTokenMandatory(url)) {
|
|
5427
|
+
try {
|
|
5428
|
+
await this.config
|
|
5429
|
+
.config()
|
|
5430
|
+
.pipe(first((val) => {
|
|
5431
|
+
return !!val && JSON.stringify(val) !== '{}';
|
|
5432
|
+
}))
|
|
5433
|
+
.toPromise();
|
|
5434
|
+
}
|
|
5435
|
+
catch (e) {
|
|
5436
|
+
// not to do
|
|
5437
|
+
}
|
|
5438
|
+
}
|
|
5428
5439
|
let resp = null;
|
|
5429
|
-
console.log('====> core 2 <====');
|
|
5430
5440
|
try {
|
|
5431
|
-
console.log(url);
|
|
5432
5441
|
resp = await this.authService.getRequestWithHeadersAsync(request);
|
|
5433
|
-
console.log('====> core 3 <====');
|
|
5434
|
-
console.log(resp);
|
|
5435
5442
|
}
|
|
5436
5443
|
catch (e) {
|
|
5437
5444
|
this.errorHandlingService.handleError(e);
|