keppelen / react-facebook-login

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

Facebook Login Popup auto opens for any path containing qurey param "code" #327

Open tabishmahfuz1 opened 3 years ago

tabishmahfuz1 commented 3 years ago

Hi, first of all thanks for this amazing library. I have encountered an issue while integrating this library with other login methods also present. Everything works fine until I get redirected from apples authentication with a query parameter code and the facebook popup would automatically open up.

I am not sure what the behavior should be, but in this case it's not creating an issue for me where I just want the app to continue with apple's login.

I think the condition can be corrected here in this function maybe but I am not sure.

// src/facebook.js
isRedirectedFromFb() {   
      const params = window.location.search;    
      return (      decodeParamForKey(params, 'state') === 'facebookdirect' && (decodeParamForKey(params, 'code') ||  
      decodeParamForKey(params, 'granted_scopes'))    );  
}
GustavoHydra commented 3 years ago

Someone please fix this. Really annoying when we are being redirected from other services and facebook pops..

iChaosren commented 2 years ago

Any update on this? We've had to remove the package and Facebook login support until this gets fixed...

greatSumini commented 2 years ago

@tabishmahfuz1 @GustavoHydra @iChaosren i fixed this issue in @greatsumini/react-facebook-login! https://github.com/greatSumini/react-facebook-login