Home > Blockchain >  react-facebook-login scope not allowing email information
react-facebook-login scope not allowing email information

Time:03-11

I'm trying to use react-facebook-login to authenticate users, but I need to access the user's email. This should be doable via the scope parameter, but it doesn't work. There are multiple issues about this subject on Github going back years that haven't been addressed.

My question is - is there a way to modify/override this package to accommodate this (it appears the scope parameter is simply not added to the popup url), since it looks good otherwise? I have no idea how to patch or override node modules.

Alternatively, what is the absolute easiest way to implement this - is getting dirty with the Javascript SDK the only way, or are there better packages?

<FacebookLogin
            appId="myappid"
            autoLoad={true}
            onClick={componentClicked}
            callback={responseFacebook}
            scope="public_profile,name,email"
        />

CodePudding user response:

The Package has no issue your app does, you need permission to access such information, while in development you can get the the information's just fine but be aware in a recent change in facebook graph api now in order to access user email you must ask for email Advanced Access you can do that by going to your app dashboard

https://developers.facebook.com/apps/appId

in the left panel click App Review and select Permission And Futures there search for email and click Get Advanced Access Clear your browser cache and you good to go

CodePudding user response:

I'm using this package instead which works as intended: https://github.com/seeden/react-facebook

  • Related