Skip to content

Instantly share code, notes, and snippets.

@lhahne
Created December 31, 2015 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lhahne/8cda593b43462914b8ae to your computer and use it in GitHub Desktop.
Save lhahne/8cda593b43462914b8ae to your computer and use it in GitHub Desktop.
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