Skip to content

Commit f6e7a12

Browse files
committed
fix(oauth): Facebook API updated
Facebook removed most default info. Must now explicitly ask for email. They also do not send usernames anymore.
1 parent 03a0ef3 commit f6e7a12

File tree

1 file changed

+5
-2
lines changed
  • app/templates/server/auth(auth)/facebook(facebookAuth)

1 file changed

+5
-2
lines changed

app/templates/server/auth(auth)/facebook(facebookAuth)/passport.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ exports.setup = function(User, config) {
55
passport.use(new FacebookStrategy({
66
clientID: config.facebook.clientID,
77
clientSecret: config.facebook.clientSecret,
8-
callbackURL: config.facebook.callbackURL
8+
callbackURL: config.facebook.callbackURL,
9+
profileFields: [
10+
'displayName',
11+
'emails'
12+
]
913
},
1014
function(accessToken, refreshToken, profile, done) {
1115
<% if (filters.mongooseModels) { %>User.findOneAsync({<% }
@@ -19,7 +23,6 @@ exports.setup = function(User, config) {
1923
name: profile.displayName,
2024
email: profile.emails[0].value,
2125
role: 'user',
22-
username: profile.username,
2326
provider: 'facebook',
2427
facebook: profile._json
2528
});

0 commit comments

Comments
 (0)