SUPPORT-8897: Fix
This commit is contained in:
parent
07ac3afa1e
commit
d7c75b3d2e
3 changed files with 0 additions and 13 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue