SUPPORT-8897: Fix

This commit is contained in:
Eduard Tihomirov 2025-02-17 16:21:27 +03:00
parent 07ac3afa1e
commit d7c75b3d2e
3 changed files with 0 additions and 13 deletions

View file

@ -1,12 +1,10 @@
import {
HttpErrorResponse,
HttpEvent,
HttpHandler,
HttpInterceptor,
HttpRequest
} from "@angular/common/http";
import {
ErrorResponse, HttpInterceptorUtils,
HttpSecurityErrorInterceptor,
MessagesService,
UserService
@ -21,8 +19,6 @@ import {AuthenticationService} from "../../security/authentication.service";
export class ErvuHttpSecurityErrorInterceptor extends HttpSecurityErrorInterceptor
implements HttpInterceptor {
private authService: AuthenticationService;
private fallbackErrorMessage: string = "Система временно недоступна. Пожалуйста, повторите попытку позже";
constructor(router: Router, messagesService: MessagesService, userService: UserService,
authService: AuthenticationService) {
@ -30,13 +26,6 @@ export class ErvuHttpSecurityErrorInterceptor extends HttpSecurityErrorIntercept
this.authService = authService;
}
protected processErrorResponseData(error: HttpErrorResponse) {
let errorResponse: ErrorResponse = HttpInterceptorUtils.getErrorResponseFromResponse(error, this.fallbackErrorMessage);
errorResponse.messages.forEach((errorMessage) => {
this.messagesService.error(errorMessage, errorResponse);
});
}
protected processAuthError(req: HttpRequest<any>, next: HttpHandler,
error: any): Observable<HttpEvent<any>> {
if (this.authService.isAuthenticated()) {