keppelen / react-facebook-login

A Component React for Facebook Login
1.18k stars 406 forks source link

Login popup is shown without clicking the Login button. #312

Open ronytesler opened 4 years ago

ronytesler commented 4 years ago

The user and password popup is shown when the site is loaded (not on refresh) and the user is not signed in.

                    <FacebookLogin
            disableMobileRedirect={true}
            appId={appId}
            autoLoad={true}
            fields="name,picture"
            onClick={this.componentClicked}
            callback={this.responseFacebook}
            render={(renderProps) => (
                <button onClick={renderProps.onClick}>{lan.buttons.facebook}</button>
            )}
        />
lareb commented 4 years ago

Does your URL has a code parameter?

ronytesler commented 4 years ago

@lareb No, this is the url: https://watoobi.appspot.com

dancherb commented 4 years ago

I'm also experiencing this. Pop-up appears as soon as the button is rendered, without the user clicking anything. Using this version:

import FacebookLogin from 'react-facebook-login/dist/facebook-login-render-props'

OdenigboGodfrey commented 4 years ago

after removing autoLoad={true} or setting it to false, it doesnt click on render, however i get no feedback on click :sigh

ronytesler commented 4 years ago

@OdenigboGodfrey On what browser and device is it happening? Can you share your code?

OdenigboGodfrey commented 3 years ago

sorry, just seeing this, No worries, I just decided to go with the "log in with facebook" button instead of the custom button. that works fine

OdenigboGodfrey commented 3 years ago

`<FacebookLogin appId={FACEBOOK_ID} autoLoad={true} fields="name,email" callback={() => this.responseFacebook()} render={renderProps => (

                        </span>
                    )}
                />`

import import FacebookLogin from 'react-facebook-login/dist/facebook-login-render-props'

Exilz commented 3 years ago

As @lareb pointed out, if you're struggling with this and have a code query parameter in your page, this will trigger facebook's popup for some reason. I gave up and renamed the parameter.

xbrunosousa commented 3 years ago

Same case here... the plugin conflicts with apple's login (which returns "code" in the url). For now, I had to disable this package.

polcham commented 3 years ago

Remove autoLoad, and onClick you have to set it to call renderProps.onClick

firmlab commented 3 years ago

Remove the autoLoad props, it works, thanks to @polcham

<FacebookLogin
            appId="XXXXXXXX"
            callback={responseFacebook}
            render={renderProps => (
                <button onClick={renderProps.onClick}>Signup with <b>Facebook</b></button>
            )}
        />