-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Description
Hi,
I found this module very useful for my usecase. However, I had issue with Authorization header not being updated. It had been sending the same header again and again. The code (after token refresh) was the following:
$http.defaults.headers.common['Authorization'] = 'Token token="' + newToken + '"';
authService.loginConfirmed();
but that didn't update the Authorization header for retried requests. After digging around for a couple of hours, I found out that the loginConfirmed method had second argument named configUpdater. I solved the problem by using it:
$http.defaults.headers.common['Authorization'] = 'Token token="' + newToken + '"';
authService.loginConfirmed(null, function(config) {
config.headers['Authorization'] = 'Token token="' + newToken + '"';
return config;
});
I hope this could save someone else's time, and it would be great if you could add some documentation for configUpdater.
Thanks,
Danijel
Metadata
Metadata
Assignees
Labels
No labels