monkey-front-core 0.0.321 → 0.0.323

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.
@@ -2749,9 +2749,6 @@ class MonkeyEcxCommonsService {
2749
2749
  }
2750
2750
  getRole() {
2751
2751
  const { __tokenCredentials } = this;
2752
- console.log('--......');
2753
- console.log(__tokenCredentials);
2754
- console.log('--......');
2755
2752
  if (!__tokenCredentials)
2756
2753
  return '';
2757
2754
  if (__tokenCredentials?.programAdmin === 'true') {
@@ -2892,13 +2889,18 @@ class MonkeyEcxCommonsService {
2892
2889
  this.__handledError = null;
2893
2890
  this.flagValidator = false;
2894
2891
  }
2895
- resolve(route, state, otherArgs) {
2892
+ async resolve(route, state, otherArgs) {
2896
2893
  if (JSON.stringify(route?.queryParams) === '{}') {
2897
2894
  this.__data = null;
2898
2895
  this.__page = null;
2899
2896
  }
2900
2897
  this.__requestPaged = null;
2901
2898
  this.flagValidator = true;
2899
+ if (this.tokenStorage) {
2900
+ this.__tokenCredentials = await this.tokenStorage.getToken();
2901
+ console.log('this.__tokenCredentials');
2902
+ console.log(this.__tokenCredentials);
2903
+ }
2902
2904
  const pend = this.allowedSecurityAccessByPendency(otherArgs?.pendency);
2903
2905
  const allowedByProgram = this.allowedSecurityAccessByFeature(otherArgs?.featureByProgram);
2904
2906
  if (this.allowedSecurityAccess(otherArgs?.security) &&
@@ -3645,6 +3647,8 @@ class MonkeyEcxTokenStorageService {
3645
3647
  }
3646
3648
  setAllTokens(token) {
3647
3649
  const { token$, store } = this;
3650
+ // #TODO - Remover esse código e apenas deixar o username
3651
+ // todo o restante ficou salvo na store com a keu sendo o username
3648
3652
  Object.entries(token).forEach(([key, value]) => {
3649
3653
  if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
3650
3654
  localStorage.setItem(key, value);
@@ -3757,6 +3761,7 @@ class MonkeyEcxTokenStorageService {
3757
3761
  }
3758
3762
  });
3759
3763
  localStorage.removeItem('me');
3764
+ localStorage.removeItem('mecx-store');
3760
3765
  const username = localStorage.getItem('username');
3761
3766
  if (username) {
3762
3767
  store.dispatch(deleteOne({ data: { username } }));