monkey-front-core 0.0.307 → 0.0.309
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/directives/monkeyecx-security-directive.mjs +2 -2
- package/esm2020/lib/core/services/commons/monkeyecx-commons.service.mjs +2 -2
- package/esm2020/lib/core/services/storage/monkeyecx-token-storage.service.mjs +28 -20
- package/fesm2015/monkey-front-core.mjs +33 -21
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +29 -21
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/commons/monkeyecx-commons.service.d.ts +2 -2
- package/lib/core/services/storage/monkeyecx-token-storage.service.d.ts +1 -1
- package/monkey-front-core-0.0.309.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.307.tgz +0 -0
|
@@ -2680,7 +2680,7 @@ class MonkeyEcxCommonsService {
|
|
|
2680
2680
|
this.__onZipCodeDataChanged$ = new BehaviorSubject(null);
|
|
2681
2681
|
this.__oni18nDataChanged$ = new BehaviorSubject(null);
|
|
2682
2682
|
this.__onDoSearch$ = new BehaviorSubject({});
|
|
2683
|
-
this.__tokenCredentials =
|
|
2683
|
+
this.__tokenCredentials = null;
|
|
2684
2684
|
this.__schedule = null;
|
|
2685
2685
|
this.__callbackPagination = () => {
|
|
2686
2686
|
// eslint-disable-next-line no-console
|
|
@@ -3656,25 +3656,33 @@ class MonkeyEcxTokenStorageService {
|
|
|
3656
3656
|
token$.next(token);
|
|
3657
3657
|
}
|
|
3658
3658
|
async getAllTokens() {
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3659
|
+
try {
|
|
3660
|
+
const { store, monkeyecxConfigService } = this;
|
|
3661
|
+
const username = localStorage.getItem('username');
|
|
3662
|
+
let data = {
|
|
3663
|
+
username: username || '',
|
|
3664
|
+
program: ''
|
|
3665
|
+
};
|
|
3666
|
+
if (username) {
|
|
3667
|
+
data = await store.select(select({ username })).pipe(take(1)).toPromise();
|
|
3668
|
+
delete data?.me;
|
|
3669
|
+
}
|
|
3670
|
+
const config = await monkeyecxConfigService.config()
|
|
3671
|
+
.pipe(first((val) => {
|
|
3672
|
+
return !!val && JSON.stringify(val) !== '{}';
|
|
3673
|
+
}))
|
|
3674
|
+
.toPromise();
|
|
3675
|
+
if (data && !data?.program && config?.program) {
|
|
3676
|
+
data.program = config?.program?.token;
|
|
3677
|
+
}
|
|
3678
|
+
return data;
|
|
3668
3679
|
}
|
|
3669
|
-
|
|
3670
|
-
.
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
.toPromise();
|
|
3674
|
-
if (data && !data?.program && config?.program) {
|
|
3675
|
-
data.program = config?.program?.token;
|
|
3680
|
+
catch (e) {
|
|
3681
|
+
console.log('=======');
|
|
3682
|
+
console.log(e);
|
|
3683
|
+
console.log('=======');
|
|
3676
3684
|
}
|
|
3677
|
-
return
|
|
3685
|
+
return null;
|
|
3678
3686
|
}
|
|
3679
3687
|
setAllMe(me) {
|
|
3680
3688
|
const { me$, store } = this;
|
|
@@ -3719,10 +3727,10 @@ class MonkeyEcxTokenStorageService {
|
|
|
3719
3727
|
meHasChanged() {
|
|
3720
3728
|
return this.me$.asObservable() || null;
|
|
3721
3729
|
}
|
|
3722
|
-
getToken() {
|
|
3730
|
+
async getToken() {
|
|
3723
3731
|
return this.getAllTokens();
|
|
3724
3732
|
}
|
|
3725
|
-
getMe() {
|
|
3733
|
+
async getMe() {
|
|
3726
3734
|
return this.getAllMe();
|
|
3727
3735
|
}
|
|
3728
3736
|
setToken(token) {
|
|
@@ -3795,7 +3803,7 @@ class MonkeyEcxSecurityDirective {
|
|
|
3795
3803
|
this.cdr = cdr;
|
|
3796
3804
|
this.roles = [];
|
|
3797
3805
|
this.byExclusion = false;
|
|
3798
|
-
this.tokenCredentials =
|
|
3806
|
+
this.tokenCredentials = null;
|
|
3799
3807
|
// not to do
|
|
3800
3808
|
}
|
|
3801
3809
|
getRole() {
|