bsphere / node-gapitoken

Node.js Google API service account authorization
51 stars 19 forks source link

Fixed scoping bug where tokens weren't being cached in the gapi instance #2

Closed allenpc closed 11 years ago

allenpc commented 11 years ago

I noticed that a new token was always being requested, even though the previous one was still valid. After checking the code, I saw that the token was being set on this.token, but it was inside a callback. Bound the gapitoken instance to self and used that instead.