我的 twitter 身份验证工作正常,但是我需要的不仅仅是用户名和显示名,这只是 Passport 的限制。
我正在尝试这样做:
var newUser = new User();
newUser.uid = profile.id;
newUser.token = token;
newUser.username = profile.username;
newUser.displayName = profile.displayName;
newUser.profile_image_url = profile.profile_image_url;
如果正在查看护照文件,它会限制您可以使用的数据。我猜如果您使用多种身份验证方法,它是一致的,但我只需要使用 twitter。
passport.use(new TwitterStrategy({ ... },
function(token, tokenSecret, profile, done) {
console.log(profile);
....
}
);
如果我只是记录配置文件,那么它会提供所有数据,所以我很困惑如何绕过它。我需要来自 twitter 的完整数据,而不仅仅是护照为我挑选的一些数据,我怎样才能得到这个?