question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authorization interceptor header

See original GitHub issue

I am using token based auth. When using the loading bar module it removes the authorization header My interceptor: request.clone({ setHeaders: { 'Authorization': Bearer ${token} } });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
arnaudgibertcommented, May 19, 2020

For future references. I had the same issue and I resolved it by making 2 changes.

  • import from app.module.ts instead of a parent module
  • import this modules before importing the module containing my other HttpInterceptors

I hope it will help…

1reaction
progtarekcommented, Feb 17, 2022

I had the same issue and I used @arnaudgibert solution and it works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP Interceptor to Set Auth Header for API Requests if User ...
The JWT Interceptor intercepts HTTP requests from the application to add a JWT auth token to the HTTP Authorization header if the user...
Read more >
Angular HTTP interceptor for Authentication header
I have to put a token inside the 'Authorization' header for every HTTP request. So I have developed and registered an HttpInterceptor :...
Read more >
How to implement automatic token insertion in requests using ...
The interceptor can help with a variety of tasks: using in authorization processes by adding a token for the request, changing headers, modifying...
Read more >
Angular Authentication: Using the Http Client and ... - Medium
Create an Interceptor. The goal is to include the JWT which is in local storage as the Authorization header in any HTTP request...
Read more >
Automatically Add Auth Token to HTTP Requests - Identity Vault
Implement Angular's HttpInterceptor class, attaching the auth token to the authorization header. import { Injectable } from '@angular/core';
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found