Created
December 31, 2015 13:22
-
-
Save lhahne/8cda593b43462914b8ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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