@arsedizioni/ars-utils 18.2.505 → 18.2.507

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.
@@ -2934,22 +2934,24 @@ class ClipperAuthInterceptor {
2934
2934
  request = request.clone({ withCredentials: true });
2935
2935
  return next.handle(this.addTokenToRequest(request))
2936
2936
  .pipe(finalize(() => this.dialogService.clearBusy()), catchError$1(error => {
2937
- if (error instanceof HttpErrorResponse &&
2938
- !request.url.includes("/login") &&
2939
- error.status === 401) {
2940
- return this.handle401Error(request, next);
2941
- }
2942
- const errorStatus = parseInt(error.status ?? "0");
2943
- if ((errorStatus > 0 && errorStatus < 500) || (this.clipperService.flags & ClipperServiceFlags.NotifySystemErrors) > 0) {
2944
- const errorTime = new Date().getTime();
2945
- if (errorTime - this.lastErrorTime > 5000) {
2946
- this.lastErrorTime = errorTime;
2947
- const invalidSession = errorStatus === 403;
2948
- this.dialogService.error("<p>" + (error.error?.message ?? error.message ?? "Impossibile eseguire l'operazione richiesta.").replaceAll("\r\n", "</p><p>") + "</p>", null, "Errore in Clipper", undefined, undefined, invalidSession ? 5000 : 15000).afterClosed().subscribe(() => {
2949
- if (invalidSession) {
2950
- this.broadcastService.sendMessage(ClipperMessages.LOGOUT);
2951
- }
2952
- });
2937
+ if (error.url.startsWith(this.clipperService.serviceUri)) {
2938
+ if (error instanceof HttpErrorResponse &&
2939
+ !request.url.includes("/login") &&
2940
+ error.status === 401) {
2941
+ return this.handle401Error(request, next);
2942
+ }
2943
+ const errorStatus = parseInt(error.status ?? "0");
2944
+ if ((errorStatus > 0 && errorStatus < 500) || (this.clipperService.flags & ClipperServiceFlags.NotifySystemErrors) > 0) {
2945
+ const errorTime = new Date().getTime();
2946
+ if (errorTime - this.lastErrorTime > 5000) {
2947
+ this.lastErrorTime = errorTime;
2948
+ const invalidSession = errorStatus === 403;
2949
+ this.dialogService.error("<p>" + (error.error?.message ?? error.message ?? "Impossibile eseguire l'operazione richiesta.").replaceAll("\r\n", "</p><p>") + "</p>", null, "Errore in Clipper", undefined, undefined, invalidSession ? 5000 : 15000).afterClosed().subscribe(() => {
2950
+ if (invalidSession) {
2951
+ this.broadcastService.sendMessage(ClipperMessages.LOGOUT);
2952
+ }
2953
+ });
2954
+ }
2953
2955
  }
2954
2956
  }
2955
2957
  return throwError(() => error);