Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$http.defaults.headers.common? #59

Open
saturation opened this issue Feb 18, 2014 · 2 comments
Open

$http.defaults.headers.common? #59

saturation opened this issue Feb 18, 2014 · 2 comments

Comments

@saturation
Copy link

I am not sure if this issue at all but something to discuss atleast.

What is the case of $http.defaults.headers.common?
I put my auth-token in there on successful login, then auth-interceptor replies failed xhrs but that auth-tokens is not there.

Of course because of this authentication failes again in backend so login will pop up again..

So should these $http.defaults.headers.common -headers always add on the top of the config?

function retryHttpRequest(config, deferred) {
    function successCallback(response) {
      deferred.resolve(response);
    }
    function errorCallback(response) {
      deferred.reject(response);
    }
    $http = $http || $injector.get('$http');
    $http(config).then(successCallback, errorCallback);
  }

or how this case should be handled?

@witoldsz
Copy link
Owner

I am sure it there was discussion about the issue here some time ago...

@alexbonhomme
Copy link

Hello there,

I'm facing the exact same problem during a refreshing access token (using refresh token). When I udpates the $http.defaults.headers.common.Authorization the Authorization header of the request isn't updated. I'm looking for a "more global" solution, but currently I only knows the solution propose in the README

If you have figure out a better solution please keep me in touch :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants