-
Notifications
You must be signed in to change notification settings - Fork 187
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
Update interceptor to allow authorization header to be overridden #77
Conversation
// Inject `Authorization` header. | ||
if (OAuthToken.getAuthorizationHeader()) { | ||
config.headers = config.headers || {}; | ||
if (!config.headers.hasOwnProperty('Authorization') && OAuthToken.getAuthorizationHeader()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lodash is used, so why not !_.has(config, 'Authorization')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use lodash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw lodash
as dependency on package.json
and jumped too fast on this 😥
Update interceptor to allow authorization header to be overridden
After this fix if you'll refresh token and after that you'll try to send old request which was waiting in a queue for refreshing token, it'll send with an old access token. |
@VyTacka Good catch. We need to fix this and bump the major version for this change. For now, I suggest removing the |
Refs #57.
Refs #74.