Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
passport.use(new FitbitStrategy({
clientID: process.env.ID,
clientSecret: process.env.SECRET,
callbackURL: host + "/auth/callback"
},
function(accessToken, refreshToken, profile, done) {
done(null, {token: accessToken});
}
));
server.get('/',
passport.authenticate('fitbit', {scope: ['weight', 'profile']}));
server.get('/auth/callback',
passport.authenticate('fitbit', { failureRedirect: '/login' }),
function(req, res) {
console.log(req.user);
res.redirect('/app.html');
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.