cuongdevjs / reactjs-social-login

Group Hook ReactJS components for login social network
https://react-social-login.netlify.app
MIT License
172 stars 76 forks source link

Twitter login modal is not closing on firefox. #96

Open hamza1216 opened 1 year ago

hamza1216 commented 1 year ago

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):

hamza1216 commented 1 year ago

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

hamza1216 commented 1 year ago

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

prem-c247 commented 1 year ago

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?

occultus73 commented 8 months ago

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,
  ]);
outlawcode commented 6 months ago

Still got error, anyone please help!

nmanikandan2016 commented 6 months ago

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.

ayanonline commented 2 months ago

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