0
我正在嘗試檢索email address, 'first-name', 'last-name', 'email-address','public-profile-url' and profile pic
顯示LinkedIn的電子郵件地址用戶使用passportjs
但是,它沒有顯示出來。我的代碼如下:
passport.use(new LinkedInStrategy({
consumerKey: LINKEDIN_API_KEY,
consumerSecret: LINKEDIN_SECRET_KEY,
callbackURL: "http://localhost:3000/auth/linkedin/callback",
scope: ['r_emailaddress', 'r_basicprofile'],
profileFields: ['id', 'first-name', 'last-name', 'email-address','public-profile-url'],
state: true
},
function(token, refreshToken, profile, done) {
console.log ("PROFILE "+profile.id, token, profile.displayName ,profile.emails[0].value);
process.nextTick(function() {
return done(null,profile);
});
})
);
前端在JADE
。
if user
| #{user.id}
| #{user.r_emailaddress}
a(href='/logout') logout with LinkedIn
注:email address
不會被顯示也沒有「直呼其名」,「最後的名字」,「電子郵件地址」,「公衆矚目的URL」。我該如何解決這個問題?