Skip to content

Commit

Permalink
fix(oauth): Facebook API updated
Browse files Browse the repository at this point in the history
Facebook removed most default info. Must now explicitly ask for email.
They also do not send usernames anymore.
  • Loading branch information
adamk33n3r committed Jul 15, 2015
1 parent 03a0ef3 commit f6e7a12
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ exports.setup = function(User, config) {
passport.use(new FacebookStrategy({
clientID: config.facebook.clientID,
clientSecret: config.facebook.clientSecret,
callbackURL: config.facebook.callbackURL
callbackURL: config.facebook.callbackURL,
profileFields: [
'displayName',
'emails'
]
},
function(accessToken, refreshToken, profile, done) {
<% if (filters.mongooseModels) { %>User.findOneAsync({<% }
Expand All @@ -19,7 +23,6 @@ exports.setup = function(User, config) {
name: profile.displayName,
email: profile.emails[0].value,
role: 'user',
username: profile.username,
provider: 'facebook',
facebook: profile._json
});
Expand Down

0 comments on commit f6e7a12

Please sign in to comment.