我正在尝试使用nodejs中的"react- Facebook - login“和"passport-facebook-token”通过facebook登录。我在web浏览器中成功登录,但在移动浏览器中收到错误"URL Bloocked“。当我在手机上切换到桌面模式时,它会成功登录。
const module.exports = passport => {
passport.use(
"facebookStrategy",
new FacebookStrategy(
{
clientID: *****,
clientSecret: "*****",
},
(accessToken, refreshToken, profile, done) => {
User.findOne({ email: profile.emails[0].value })
.then(user => {
if (user) {
return done(null, user);
} else {
//create new profile
const newProfile = new Profile({
user: newUser.id,
username: profile.displayName,
email: profile.emails[0].value,
profilepic: profile.photos[0].value
});
newProfile
.save()
.catch(err =>
console.log("Error in creating new profile " + err)
);
return done(null, newProfile);
}
})
.catch(err => console.log(err));
}
));};
发布于 2019-05-27 17:49:07
这是移动浏览器中常见的问题,你会发现它也存在于一些android设备中。
为预防起见,最好手动构建登录流。转到此处https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
因此,是的,您将需要使用手动集成。但是,毫无疑问,它将是完全可靠的集成。
https://stackoverflow.com/questions/56323544
复制相似问题