angularjs-django-rest-framework-seed icon indicating copy to clipboard operation
angularjs-django-rest-framework-seed copied to clipboard

Deferred requests with no auth token

Open danielmana opened this issue 10 years ago • 0 comments

Once you are logged and call authService.loginConfirmed the service will retry deferred requests with their previous configuration, so the authenticated ones will still fail because the auth header is not there yet. To force the header an updater can be used:

var updater = function (config) {
  config.headers.Authorization = 'Token ' + response.token;
  return config;
};
authService.loginConfirmed({}, updater);

danielmana avatar Jun 16 '14 15:06 danielmana