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

Update interceptor to allow authorization header to be overridden #77

Merged
merged 2 commits into from
Feb 8, 2016

Conversation

ruipenso
Copy link
Member

@ruipenso ruipenso commented Feb 4, 2016

Refs #57.
Refs #74.

// Inject `Authorization` header.
if (OAuthToken.getAuthorizationHeader()) {
config.headers = config.headers || {};
if (!config.headers.hasOwnProperty('Authorization') && OAuthToken.getAuthorizationHeader()) {
Copy link
Collaborator

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')?

Copy link
Member Author

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.

Copy link
Collaborator

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 😥

pgom added a commit that referenced this pull request Feb 8, 2016
Update interceptor to allow authorization header to be overridden
@pgom pgom merged commit b2a8974 into master Feb 8, 2016
@pgom pgom deleted the enhancement/authorization-header branch February 8, 2016 13:28
@vytant
Copy link

vytant commented Feb 12, 2016

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.

@ruipenso
Copy link
Member Author

@VyTacka Good catch. We need to fix this and bump the major version for this change.

For now, I suggest removing the Authorization header before replying the request.

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

Successfully merging this pull request may close these issues.

3 participants