monkey-front-core 0.0.356 → 0.0.358

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.
@@ -4118,8 +4118,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
4118
4118
  }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
4119
4119
 
4120
4120
  class MonkeyEcxAuthGuardByRole {
4121
- constructor(monkeyecxAuthenticationService, router) {
4122
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
4121
+ constructor(tokenStorage, router) {
4122
+ this.tokenStorage = tokenStorage;
4123
4123
  this.router = router;
4124
4124
  this.securityCredentials = null;
4125
4125
  this.tokenCredentials = null;
@@ -4170,34 +4170,27 @@ class MonkeyEcxAuthGuardByRole {
4170
4170
  }
4171
4171
  async canActivate(route, state) {
4172
4172
  this.securityCredentials = route.data?.securityCredentials;
4173
- console.log('this.securityCredentials');
4174
- console.log(this.securityCredentials);
4175
4173
  if (this.securityCredentials) {
4176
4174
  const { roles, byExclusion } = this.securityCredentials;
4177
4175
  if (!this.tokenCredentials) {
4178
- this.tokenCredentials = await this.monkeyecxAuthenticationService.getToken();
4176
+ this.tokenCredentials = await this.tokenStorage.getToken();
4179
4177
  }
4180
- console.log('this.tokenCredentials');
4181
- console.log(this.tokenCredentials);
4182
- console.log('checando');
4183
4178
  if (!this.allowedSecurityAccess(roles, byExclusion)) {
4184
- console.log('checou erro');
4185
4179
  this.navigateToErrorPage();
4186
4180
  return false;
4187
4181
  }
4188
- console.log('checou ok');
4189
4182
  }
4190
4183
  return true;
4191
4184
  }
4192
4185
  }
4193
- MonkeyEcxAuthGuardByRole.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxAuthGuardByRole, deps: [{ token: MonkeyEcxAuthenticationService }, { token: i2$2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
4186
+ MonkeyEcxAuthGuardByRole.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxAuthGuardByRole, deps: [{ token: MonkeyEcxTokenStorageService }, { token: i2$2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
4194
4187
  MonkeyEcxAuthGuardByRole.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxAuthGuardByRole, providedIn: 'root' });
4195
4188
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxAuthGuardByRole, decorators: [{
4196
4189
  type: Injectable,
4197
4190
  args: [{
4198
4191
  providedIn: 'root'
4199
4192
  }]
4200
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: i2$2.Router }]; } });
4193
+ }], ctorParameters: function () { return [{ type: MonkeyEcxTokenStorageService }, { type: i2$2.Router }]; } });
4201
4194
 
4202
4195
  class MonkeyEcxAuthGuard {
4203
4196
  constructor(monkeyecxAuthenticationService) {