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

Undocumented data schema dependency for token for API functions #11

Open
BarrieP opened this issue Mar 7, 2016 · 0 comments
Open

Undocumented data schema dependency for token for API functions #11

BarrieP opened this issue Mar 7, 2016 · 0 comments

Comments

@BarrieP
Copy link

BarrieP commented Mar 7, 2016

api.js line 29 //TODO: improve this way of getting the token

Being new to a lot of this stuff, this undocumented data schema dependency has had me scratching my head for a bit :)

Might you do the TODO soon?
Or do you have a preferred solution to this?

N.B. this was exposed by your two fitbit projects having incompatible names :

  • This fitbit-client-oauth2 project expects "access_token"
  • The passport-fitbit-oauth2 project saves it as "accessToken"

( Obviously I prefer to use passport, but I also want to use your API functions! )

So a quick and dirty fix for me was to rename where it's saved to suit this project.

from passport-fitbit-oauth2 project example :

var fitbitStrategy = new FitbitStrategy({
clientID: CLIENT_ID,
clientSecret: CLIENT_SECRET,
scope: ['activity','heartrate','location','profile'],
callbackURL: "http://localhost:3000/auth/fitbit/callback"
}, function(accessToken, refreshToken, profile, done) {
// TODO: save accessToken here for later use

done(null, {
    access_token: accessToken, **// MODIFIED was accessToken**
    refreshToken: refreshToken,
    profile: profile
});

});

Then this whole user object can be passed to the API function in this fitbit-client-oauth2 project.

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

No branches or pull requests

1 participant