Passport-Facebook not providing email even if it is in scope

后端 未结 3 2037
旧时难觅i
旧时难觅i 2021-02-04 03:09

In my application i register the facebook-strategie as follows: But the returned profile does not contain the email-field....

passport.use(new FacebookStrategy({         


        
3条回答
  •  庸人自扰
    2021-02-04 03:37

    You do have the callback part of the code, right?:

    app.get('/oauth/facebook/callback', passport.authenticate('facebook', {
        failureRedirect: '/login',
        successRedirect: '/',
        scope:['email']
    }));
    

    And, yes, indeed, this should be done with the scope:['email'], as per instructions from your link and this one here also.

提交回复
热议问题