-
Notifications
You must be signed in to change notification settings - Fork 22
Updates to 401 Handling #64
Updates to 401 Handling #64
Conversation
options.headers.Authorization = options.headers.Authorization || 'Bearer ' + authResponse.accessToken; | ||
|
||
if(options.headers.Authorization) { | ||
retry = false; |
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.
Missing options.headers.Authorization = options.headers.Authorization
in this block.
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.
Actually, nevermind, just realized how dumb that would be.
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.
Based on that new realization, we should probably just var retry = false
at the top, and these two blocks can just become one:
if(!options.headers.Authorization) {
options.headers.Authorization = 'Bearer ' + authResponse.accessToken;
retry = options.retry || false;
}
Seems good to me. @vernak2539 ? |
|
||
if(!options.headers.Authorization) { | ||
options.headers.Authorization = 'Bearer ' + authResponse.accessToken; | ||
retry = options.retry || false; |
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.
So only retry if they don't provide custom auth headers?
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.
correct, thoughts?
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.
At first I wondered, but now I think it's fine. Since the auth header shouldn't really diff from the one provided (just there for an extra option), this is totally cool. 👍
So yeah, good to go @dougwilson if you want to publish. I'll be pto for a till next week. |
No description provided.