@arsedizioni/ars-utils 19.0.14 → 19.0.16

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.
@@ -3098,8 +3098,8 @@ class ClipperAuthInterceptor {
3098
3098
  .pipe(finalize$1(() => this.dialogService.clearBusy()), catchError$1(error => {
3099
3099
  if (error.url.startsWith(this.clipperService.serviceUri)) {
3100
3100
  if (error instanceof HttpErrorResponse &&
3101
- !request.url.includes("/login") &&
3102
- error.status === 401) {
3101
+ error.status === 401 &&
3102
+ !request.url.includes("/login")) {
3103
3103
  return this.handle401Error(request, next);
3104
3104
  }
3105
3105
  const errorStatus = parseInt(error.status ?? "0");
@@ -3155,15 +3155,17 @@ class ClipperAuthInterceptor {
3155
3155
  */
3156
3156
  addTokenToRequest(request, token = null) {
3157
3157
  if (request.url.startsWith(this.clipperService.serviceUri)) {
3158
- if (!token)
3159
- token = this.clipperService.getToken();
3160
- if (token) {
3161
- return request.clone({
3162
- setHeaders: {
3163
- Authorization: 'Bearer ' + token,
3164
- 'ngsw-bypass': 'ngsw-bypass'
3165
- },
3166
- });
3158
+ if (!this.clipperService.loggedIn()) {
3159
+ if (!token)
3160
+ token = this.clipperService.getToken();
3161
+ if (token) {
3162
+ return request.clone({
3163
+ setHeaders: {
3164
+ Authorization: 'Bearer ' + token,
3165
+ 'ngsw-bypass': 'ngsw-bypass'
3166
+ },
3167
+ });
3168
+ }
3167
3169
  }
3168
3170
  }
3169
3171
  return request;