monkey-front-core 0.0.198 → 0.0.199
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-header.interceptor.mjs +7 -28
- package/fesm2015/monkey-front-core.mjs +5 -26
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +5 -26
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/interceptors/monkeyecx-http-config-header.interceptor.d.ts +0 -1
- package/monkey-front-core-0.0.199.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.198.tgz +0 -0
|
@@ -4685,15 +4685,14 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
|
|
|
4685
4685
|
const { url } = request;
|
|
4686
4686
|
if (this.authService.isTokenMandatory(url)) {
|
|
4687
4687
|
try {
|
|
4688
|
-
|
|
4688
|
+
await this.config
|
|
4689
4689
|
.config()
|
|
4690
|
-
.pipe(
|
|
4690
|
+
.pipe(first((val) => {
|
|
4691
|
+
return !!val;
|
|
4692
|
+
}))
|
|
4691
4693
|
.toPromise();
|
|
4692
|
-
if (!config) {
|
|
4693
|
-
await this.onValidateConfig();
|
|
4694
|
-
}
|
|
4695
4694
|
}
|
|
4696
|
-
catch (
|
|
4695
|
+
catch (e) {
|
|
4697
4696
|
// not to do
|
|
4698
4697
|
}
|
|
4699
4698
|
}
|
|
@@ -4712,26 +4711,6 @@ class MonkeyEcxHttpConfigHeaderInterceptor {
|
|
|
4712
4711
|
}))
|
|
4713
4712
|
.toPromise();
|
|
4714
4713
|
}
|
|
4715
|
-
onValidateConfig() {
|
|
4716
|
-
return new Promise((resolve) => {
|
|
4717
|
-
let count = 0;
|
|
4718
|
-
const interval = setInterval(async () => {
|
|
4719
|
-
count += 1;
|
|
4720
|
-
if (count > 20) {
|
|
4721
|
-
clearInterval(interval);
|
|
4722
|
-
resolve(null);
|
|
4723
|
-
}
|
|
4724
|
-
const config = await this.config
|
|
4725
|
-
.config()
|
|
4726
|
-
.pipe(take(1))
|
|
4727
|
-
.toPromise();
|
|
4728
|
-
if (config) {
|
|
4729
|
-
clearInterval(interval);
|
|
4730
|
-
resolve(null);
|
|
4731
|
-
}
|
|
4732
|
-
}, 200);
|
|
4733
|
-
});
|
|
4734
|
-
}
|
|
4735
4714
|
intercept(request, next) {
|
|
4736
4715
|
return from(this.handle(request, next));
|
|
4737
4716
|
}
|