diff --git a/src/app/interceptors/token.interceptors.ts b/src/app/interceptors/token.interceptors.ts index b0916499f..3097ebb91 100644 --- a/src/app/interceptors/token.interceptors.ts +++ b/src/app/interceptors/token.interceptors.ts @@ -23,7 +23,7 @@ export class TokenInterceptor implements HttpInterceptor { null ); - private excludedDomains = ['Login', environment.apiChatUrl]; // Add the domains you want to exclude + private excludedDomains = [ environment.apiChatUrl]; // Add the domains you want to exclude constructor(private http: HttpClient, private router: Router,private httpErrorHandle: HttpErrorHandle,) { } @@ -42,9 +42,13 @@ export class TokenInterceptor implements HttpInterceptor { } return next.handle(request).pipe( + catchError((error) => { + console.log('interceptor ',error) if (error instanceof HttpErrorResponse && error.status === 401) { return this.handle401Error(request, next); + } else if (error.url.includes('https://gdapi-dev.dyndns.info/stage/api/v2') && error.status === 0){ + return this.handle401Error(request, next); } else { return throwError(error); }