angularjs-django-rest-framework-seed
angularjs-django-rest-framework-seed copied to clipboard
Deferred requests with no auth token
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);