Skip to content
Snippets Groups Projects
Commit ce9c8351 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

fix double request error

parent 3095ee99
No related branches found
No related tags found
No related merge requests found
import { Injectable } from '@angular/core';
import { HttpHandler, HttpInterceptor, HttpRequest, HttpClient } from '@angular/common/http';
import { HttpHandler, HttpInterceptor, HttpRequest, HttpClient, HttpErrorResponse } from '@angular/common/http';
import { LANG } from '../app/translate.component';
import { catchError, switchMap } from 'rxjs/operators';
import { NotificationService } from '../app/notification.service';
......@@ -124,7 +124,14 @@ export class AuthInterceptor implements HttpInterceptor {
} else if (error.error.errors === 'User must change his password') {
return this.router.navigate(['/password-modification']);
} else {
return next.handle(request);
const response = new HttpErrorResponse({
error: error.error,
status: error.status,
statusText: error.statusText,
headers: error.headers,
url: error.url,
});
return Promise.reject(response);
}
})
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment