Implement an HTTP interceptor to inject the JWT into the header of every request sent to the user and also gracefully handle authentication failures by asking the user to log in:
- Create authHttpInterceptor under auth:
src/app/auth/auth-http-interceptor.tsimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest,} from '@angular/common/http'import { Injectable } from '@angular/core'import { Router } from '@angular/router'import { Observable, throwError as observableThrowError } from 'rxjs'import { catchError } from 'rxjs/operators'import { AuthService } from './auth.service'@Injectable()export class AuthHttpInterceptor implements HttpInterceptor { constructor(private authService: AuthService, private router: Router) ...