Retrieving photo from Facebook using passport-facebook

前端 未结 5 1882
醉梦人生
醉梦人生 2021-02-13 02:44

I am able to retrieve basic user information via passport-facebook, following the below code and saving in mongodb:

app.get(\"/auth/facebook\", passport.authenti         


        
5条回答
  •  时光说笑
    2021-02-13 03:08

    If you need a larger image (default in miksii's example above is 50px x 50px which is pretty small), then use:

    profileFields: ['id', 'displayName', 'name', 'gender', 'picture.type(large)']
    

    and then

    picture: profile.photos ? profile.photos[0].value : '/img/faces/unknown-user-pic.jpg'
    

    This will return a 200px x 200px profile picture for that user.

提交回复
热议问题