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.


[image: picture.png]


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


-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/a33eb8e9-b38b-4cdd-933b-5832908e03ad%40googlegroups.com.

Reply via email to