0
我正在使用护照的FB策略以及本地登录名创建express4应用程序。我一直在捕获用户的电子邮件,作为链接本地和FB账户的一种方式。突然,(在FB创建新测试应用程序的时候),我不再收到登录FB的电子邮件。鉴于我使用自己的帐户进行测试,应该没有问题。这里的FB策略:Facebook API不再为使用护照的用户登录FB提供电子邮件策略
GET /auth/facebook 302 0.981 ms - 0
{ id: 'xxxxxxxxxxxxxxx',
username: undefined,
displayName: 'Dan Donaldson',
name:
{ familyName: undefined,
givenName: undefined,
middleName: undefined },
gender: undefined,
profileUrl: undefined,
provider: 'facebook',
_raw: '{"id":"xxxxxxxxxxxxxxx","name":"Dan Donaldson"}',
_json: { id: 'xxxxxxxxxxxxxxx', name: 'Dan Donaldson' } }
任何人看到这个问题:
passport.use(new FacebookStrategy({
clientID: ids.facebook.clientID,
clientSecret: ids.facebook.clientSecret,
callbackURL: ids.facebook.callbackURL,
enableProof: false,
profileFields: ['id', 'displayName', 'emails']
},
function(accessToken, refreshToken, profile, done) {
console.log(profile)
User.findOne({ username: profile.emails[0].value }, function (err, user) {
if(err) {
return done(err)
}
if (user) {
// if doesn't contain facebook id, add it
user.update({facebookId : profile.id}, function(err, user) {
if (err) {
return done(err)
}
})
return done(null, user)
}
if (! user) {
User.create({username: profile.emails[0].value, facebookId: profile.id}, function(err, user) {
if(err) {
return done(err, null)
}
return done(null, user)
})
}
});
}
));
,现在会显示配置文件返回该行? FB不再为登录主应用程序或创建的测试应用程序的用户提供电子邮件。我有一种感觉,这是一个FB问题,而不是节点/ js /快递/护照问题,因为没有任何关系的代码更改似乎与此相关...。
我想这不是Facebook的错误。并且代码不要求电子邮件字段。 – WizKid
如果更改内容,请阅读更改日志 - 我的猜测是“声明性字段”,在更新日志中搜索该内容。 – luschn
问题通过在路线中添加字段说明来解决: –