added facebook email permission to route /auth/facebook

pull/2/head
Sahat Yalkabov 2013-11-23 14:43:51 -05:00
parent 378760377b
commit ddda818e69
1 changed files with 9 additions and 1 deletions

10
app.js
View File

@ -59,7 +59,15 @@ app.get('/api/foursquare', passportConf.ensureAuthenticated, api.foursquare);
app.get('/contact', contact.getContact); app.get('/contact', contact.getContact);
app.post('/contact', contact.postContact); app.post('/contact', contact.postContact);
app.get('/auth/facebook', passport.authenticate('facebook')); app.get('/auth/facebook', passport.authenticate('facebook', {
scope: [
'email'
]
}), function(req, res) {
// The request will be redirected to Facebook for authentication, so this
// function will not be called.
});
app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: '/login' })); app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: '/login' }));