reactjs-social-login icon indicating copy to clipboard operation
reactjs-social-login copied to clipboard

Twitter login modal is not closing on firefox.

Open hamza1216 opened this issue 2 years ago • 7 comments

Describe the bug Twitter login modal is not closing on firefox. To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://react-social-login.netlify.app/'
  2. Click on 'Login with twitter'
  3. After login successful, you can see the login modal is still remaining.

Expected behavior The login modal should be closed. It's working on chrome, but not on firefox.

Screenshots image

Desktop (please complete the following information):

  • OS: [MacOS 13.1 (22C65)]
  • Browser [Firefox]
  • Version [110.0 (64-bit]

hamza1216 avatar Feb 22 '23 10:02 hamza1216

Maybe it might be related with this issue. https://stackoverflow.com/questions/12314729/close-windows-that-were-not-opened-by-script-using-javascript

hamza1216 avatar Feb 22 '23 10:02 hamza1216

instagram is working, but not sure why it's not working for twitter on firefox.

hamza1216 avatar Mar 29 '23 09:03 hamza1216

Facebook and google login is working on all browsers closing the window when login successfully, but the twitter model is no closing on Firefox browser. same issues as above, anyone having any solution for it?

prem-c247 avatar Aug 01 '23 09:08 prem-c247

This is still an issue; I have recreated it. Could it have something to do with the onLogin callback at line 131 of LoginSocialTwitter?

  const onLogin = useCallback(async () => {
    onLoginStart && onLoginStart();
    window.addEventListener('storage', onChangeLocalStorage, false);
    const oauthUrl = `${TWITTER_URL}/i/oauth2/authorize?response_type=code&client_id=${client_id}&redirect_uri=${redirect_uri}&scope=${scope}&state=${state+'_twitter'}&code_challenge=challenge&code_challenge_method=plain`;
    const width = 450;
    const height = 730;
    const left = window.screen.width / 2 - width / 2;
    const top = window.screen.height / 2 - height / 2;
    window.open(
      oauthUrl,
      'twitter',
      'menubar=no,location=no,resizable=no,scrollbars=no,status=no, width=' +
        width +
        ', height=' +
        height +
        ', top=' +
        top +
        ', left=' +
        left,
    );
  }, [
    scope,
    state,
    client_id,
    onLoginStart,
    redirect_uri,
    onChangeLocalStorage,
  ]);

occultus73 avatar Feb 17 '24 19:02 occultus73

Still got error, anyone please help!

outlawcode avatar Apr 06 '24 02:04 outlawcode

The Twitter window is not closing, also the onResolve function is not being called, how do we receive data from Twitter. I'm using Microsoft Edge browser. @cuongdevjs please help.

nmanikandan2016 avatar Apr 24 '24 05:04 nmanikandan2016

The Twitter window is not closing, also the onResolve function is not being called, how do we receive data from Twitter. I'm using Microsoft Edge browser. @cuongdevjs please help.

I am also facing the same issue

typescript-any avatar Aug 27 '24 18:08 typescript-any