-
Notifications
You must be signed in to change notification settings - Fork 6
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 Sugar client token handling #135
Conversation
auth._bearerToken is undefined as of 3.3.0, so pass the token to Sugar from auth.checkBearerToken(). Check the current token before each Sugar API request.
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.
There's a breaking change here in the inclusion of the beforeEveryRequest
mixin with the JSONAPIClient
instantiation. For reference, here is where mixins are merged in the object constructor.
I tested this with npm link
on this branch against a local version of PFE. I noticed a crash when visiting the "I Fancy Cats" project on staging. PFE worked well when I took out the mixin (lines 13-19 in sugar.js).
Testing this, I noticed that PFE is still on |
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.
Nice. This looks good to me. I can't think of any reason not to bump PJC on PFE. Perhaps that can happen after this is merged and published.
Missed in #135: Promise.all should take an array as an argument. I've also added better error-logging to debug Sugar client errors.
auth._bearerToken
is undefined as of 3.3.0, so pass the token to Sugar fromauth.checkBearerToken()
.Check the current token before each Sugar API request.