monkey-front-core 0.0.140 → 0.0.141

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.
@@ -3153,6 +3153,10 @@ class MonkeyEcxAuthenticationService {
3153
3153
  console.error('isAuthorized needs to be declared!');
3154
3154
  return false;
3155
3155
  };
3156
+ this.isCompanyAuthorized = () => {
3157
+ console.error('isCompanyAuthorized needs to be declared!');
3158
+ return false;
3159
+ };
3156
3160
  this.getRequestWithHeaders = (request) => {
3157
3161
  console.error('getRequestWithHeaders needs to be declared!');
3158
3162
  return null;
@@ -3174,11 +3178,11 @@ class MonkeyEcxAuthenticationService {
3174
3178
  init(args) {
3175
3179
  this.hadAtLeastOneLogin = args?.hadAtLeastOneLogin || this.hadAtLeastOneLogin.bind(this);
3176
3180
  this.redirectApp = args?.redirectApp || this.redirectApp.bind(this);
3177
- this.redirectLoginWelcomeBack = args?.redirectLoginWelcomeBack ||
3178
- this.redirectLoginWelcomeBack.bind(this);
3181
+ this.redirectLoginWelcomeBack =
3182
+ args?.redirectLoginWelcomeBack || this.redirectLoginWelcomeBack.bind(this);
3179
3183
  this.isAuthorized = args?.isAuthorized || this.isAuthorized.bind(this);
3180
- this.getRequestWithHeaders = args?.getRequestWithHeaders ||
3181
- this.getRequestWithHeaders.bind(this);
3184
+ this.getRequestWithHeaders =
3185
+ args?.getRequestWithHeaders || this.getRequestWithHeaders.bind(this);
3182
3186
  this.getRequestWithHeadersOb = args?.getRequestWithHeadersOb.bind(this);
3183
3187
  this.refreshShouldHappen = args?.refreshShouldHappen || this.refreshShouldHappen.bind(this);
3184
3188
  this.refreshToken = args?.refreshToken || this.refreshToken.bind(this);
@@ -3189,10 +3193,34 @@ MonkeyEcxAuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion:
3189
3193
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MonkeyEcxAuthenticationService, decorators: [{
3190
3194
  type: Injectable,
3191
3195
  args: [{
3192
- providedIn: 'root'
3196
+ providedIn: 'root',
3193
3197
  }]
3194
3198
  }], ctorParameters: function () { return []; } });
3195
3199
 
3200
+ class MonkeyEcxAuthGuardCompany {
3201
+ constructor(monkeyecxAuthenticationService) {
3202
+ this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3203
+ // not to do
3204
+ }
3205
+ canActivate() {
3206
+ const { monkeyecxAuthenticationService } = this;
3207
+ if (monkeyecxAuthenticationService.isAuthorized() &&
3208
+ monkeyecxAuthenticationService.isCompanyAuthorized()) {
3209
+ return true;
3210
+ }
3211
+ monkeyecxAuthenticationService.redirectLoginWelcomeBack();
3212
+ return false;
3213
+ }
3214
+ }
3215
+ MonkeyEcxAuthGuardCompany.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MonkeyEcxAuthGuardCompany, deps: [{ token: MonkeyEcxAuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
3216
+ MonkeyEcxAuthGuardCompany.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MonkeyEcxAuthGuardCompany, providedIn: 'root' });
3217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: MonkeyEcxAuthGuardCompany, decorators: [{
3218
+ type: Injectable,
3219
+ args: [{
3220
+ providedIn: 'root',
3221
+ }]
3222
+ }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
3223
+
3196
3224
  class MonkeyEcxAuthGuardLogin {
3197
3225
  constructor(monkeyecxAuthenticationService) {
3198
3226
  this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;