You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The place to do something with the token is in the callback you've added in the instance passport.use(new FitbitStrategy({..config..}, function() { /* HERE YOU HAVE THE TOKEN */}). In the /auth/fitbit/callback you only need to point to fail/success urls, no need for a callback there.
I'm having trouble with
Failed to obtain access token
I think the problem is likely that I don't have the right stuff in /auth/fitbit/callback
This is what I've got:
app.get('/auth/fitbit',
passport.authenticate('fitbit', { scope: ['activity','heartrate','location','profile'] }
));
app.get('/auth/fitbit/callback', passport.authenticate('fitbit', { failureRedirect: '/?error=auth_failed' }),
function(req, res) {
// Successful authentication, redirect home.
res.redirect('/phone');
}
);
As I said, I suspect I need to do more with the /auth/fitbit/callback portion to actually exchange the code for a token.
The text was updated successfully, but these errors were encountered: