@alfresco/aca-shared 7.5.0-27344658676 → 7.5.0-27347350236

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.
@@ -21,7 +21,6 @@ import { MatButtonModule } from '@angular/material/button';
21
21
  import * as i3 from '@angular/material/icon';
22
22
  import { MatIconModule, MatIconRegistry } from '@angular/material/icon';
23
23
  import { A11yModule } from '@angular/cdk/a11y';
24
- import { minimatch } from 'minimatch';
25
24
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
26
25
  import { DomSanitizer } from '@angular/platform-browser';
27
26
  import * as i2$1 from '@angular/material/menu';
@@ -1234,19 +1233,18 @@ class AppService {
1234
1233
  }
1235
1234
  init() {
1236
1235
  this.alfrescoApiService.getInstance().on('error', (error) => {
1237
- if (error.status === 401 && !this.alfrescoApiService.isExcludedErrorListener(error?.response?.req?.url)) {
1238
- const publicUrls = this.config.get('oauth2.publicUrls', []);
1239
- const isPublicUrl = publicUrls.some((pattern) => minimatch(this.router.url, pattern));
1240
- if (!this.authenticationService.isLoggedIn() && !isPublicUrl) {
1241
- this.matDialog.closeAll();
1242
- let redirectUrl = this.activatedRoute.snapshot.queryParams['redirectUrl'];
1243
- if (!redirectUrl) {
1244
- redirectUrl = this.router.url;
1245
- }
1246
- this.router.navigate(['/login'], {
1247
- queryParams: { redirectUrl }
1248
- });
1236
+ const shouldNavigateToLogin = error.status === 401 &&
1237
+ !this.alfrescoApiService.isExcludedErrorListener(error?.response?.req?.url) &&
1238
+ !this.authenticationService.isLoggedIn();
1239
+ if (shouldNavigateToLogin) {
1240
+ this.matDialog.closeAll();
1241
+ let redirectUrl = this.activatedRoute.snapshot.queryParams['redirectUrl'];
1242
+ if (!redirectUrl) {
1243
+ redirectUrl = this.router.url;
1249
1244
  }
1245
+ this.router.navigate(['/login'], {
1246
+ queryParams: { redirectUrl }
1247
+ });
1250
1248
  }
1251
1249
  });
1252
1250
  this.loadCustomCss();