I have HttpErrorInterceptor and AuthInterceptor. Both of them are
handling error code 400. The problem occurs while I'm trying to refresh
the jwt token and the backend throws a bad request because either the
refresh token has expired or it's invalid. In case that bad request
happens on /api/token/refresh, I just want to log out the user and suppress all errors.
I added an additional header which is supposed to skip the error modal
window in HttpErrorInterceptor but the problem is that the actual error
happens before the skip code and in the end that annoying modal window
message appears.
If you look at the image below, you will see that this.authService.logout() was executed and right after it the HTTP Interceptor Skip (from HttpErrorInterceptor) and the actual error was displayed above them.

How can I suppress all error messages for /api/token/refresh (this.authService.refreshToken()), so when it fails, it wouldn't pop that modal window up with error code 400?
https://stackblitz.com/edit/angular-dziwbx
I have HttpErrorInterceptor and AuthInterceptor. Both of them are
handling error code 400. The problem occurs while I'm trying to refresh
the jwt token and the backend throws a bad request because either the
refresh token has expired or it's invalid. In case that bad request
happens on /api/token/refresh, I just want to log out the user and suppress all errors.
I added an additional header which is supposed to skip the error modal
window in HttpErrorInterceptor but the problem is that the actual error
happens before the skip code and in the end that annoying modal window
message appears.
If you look at the image below, you will see that this.authService.logout() was executed and right after it the HTTP Interceptor Skip (from HttpErrorInterceptor) and the actual error was displayed above them.
I have HttpErrorInterceptor and AuthInterceptor. Both of them are
handling error code 400. The problem occurs while I'm trying to refresh
the jwt token and the backend throws a bad request because either the
refresh token has expired or it's invalid. In case that bad request
happens on /api/token/refresh, I just want to log out the user and suppress all errors.
I added an additional header which is supposed to skip the error modal
window in HttpErrorInterceptor but the problem is that the actual error
happens before the skip code and in the end that annoying modal window
message appears.
If you look at the image below, you will see that this.authService.logout() was executed and right after it the HTTP Interceptor Skip (from HttpErrorInterceptor) and the actual error was displayed above them.
