monkey-front-core 0.0.382 → 0.0.384
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 +3 -2
- package/esm2020/lib/core/services/storage/monkeyecx-token-storage.service.mjs +17 -2
- package/fesm2015/monkey-front-core.mjs +13 -2
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +18 -2
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/storage/monkeyecx-token-storage.service.d.ts +1 -21
- package/monkey-front-core-0.0.384.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.382.tgz +0 -0
|
@@ -3649,6 +3649,13 @@ class MonkeyEcxTokenStorageService {
|
|
|
3649
3649
|
refreshToken
|
|
3650
3650
|
};
|
|
3651
3651
|
}
|
|
3652
|
+
if (!data.role) {
|
|
3653
|
+
const role = localStorage.getItem('role');
|
|
3654
|
+
data = {
|
|
3655
|
+
...data,
|
|
3656
|
+
role
|
|
3657
|
+
};
|
|
3658
|
+
}
|
|
3652
3659
|
const handledData = {
|
|
3653
3660
|
...data,
|
|
3654
3661
|
accessType,
|
|
@@ -3700,7 +3707,15 @@ class MonkeyEcxTokenStorageService {
|
|
|
3700
3707
|
if (username) {
|
|
3701
3708
|
data = await store.select(select({ username })).pipe(take(1)).toPromise();
|
|
3702
3709
|
}
|
|
3703
|
-
|
|
3710
|
+
let handledData = {
|
|
3711
|
+
...data
|
|
3712
|
+
};
|
|
3713
|
+
if (!handledData.me) {
|
|
3714
|
+
handledData = {
|
|
3715
|
+
me: localStorage.getItem('me')
|
|
3716
|
+
};
|
|
3717
|
+
}
|
|
3718
|
+
return handledData?.me;
|
|
3704
3719
|
}
|
|
3705
3720
|
tokenHasChanged() {
|
|
3706
3721
|
return this.token$.asObservable();
|
|
@@ -3798,7 +3813,8 @@ class MonkeyEcxSecurityDirective {
|
|
|
3798
3813
|
if (tokenCredentials?.programAdmin === true) {
|
|
3799
3814
|
return 'PROGRAM_ADMIN';
|
|
3800
3815
|
}
|
|
3801
|
-
|
|
3816
|
+
const handledRole = localStorage.getItem('role');
|
|
3817
|
+
return tokenCredentials?.role || handledRole || '';
|
|
3802
3818
|
}
|
|
3803
3819
|
handleAccess() {
|
|
3804
3820
|
const { roles, byExclusion } = this;
|