1

I am trying to login by Facebook using "react-facebook-login" and "passport-facebook-token" in nodejs. I logged successfully in the web browser but i am getting an error "URL Bloocked" in mobile browser. When i am switching to desktop mode on my phone its successfully login.

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));
  }
)

); };

Gal Taebi
  • 13
  • 3
  • Please check if this helps https://stackoverflow.com/questions/37001004/facebook-login-message-url-blocked-this-redirect-failed-because-the-redirect – Suresh Prajapati May 27 '19 at 09:55

1 Answers1

0

This is common issue among mobile browsers and you will find that it would also be in some android devices.

For precaution it is under best practice to build flow of login manually. Go here https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow

So yes, you will need to go with manual integration. But, it will be full-proof integration without doubts.

Integraty_dev
  • 500
  • 3
  • 18