Search code examples
reactjsfacebook

react-facebook-login scope not allowing email information


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"
        />

Solution

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