Install the angular-jwt library using NPM: npm install @auth0/angular-jwt. Alternatively, create a HTTP interceptor yourself.
In your AppModule, you need to provide the way for the interceptor to retrieve the JWT. This should enable the HttpClient to get the JWT and include it in every request. Usually, you store the token either in a cookie (preferred) or in the browser storage.
Import the HttpClientModule in your module. This is required in order to inject the HttpClient service in a component/service/pipe/directive.
Use the HttpClient to send HTTP requests which will now include the JWT automatically.
Top comments (3)
See this SO answer, header can be accessed from the response class : stackoverflow.com/a/44292610
sorry bro i didnt get the answer in this way
How to send JWT in every HTTP request in Angular
Source: itnext.io/how-to-send-jwt-automati...