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

OnResolve Not Called When Instagram #175

Open ptahchiev opened 4 months ago

ptahchiev commented 4 months ago

I am using the LoginSocialInstagram and I see that it's not calling the onResolve function.

It works fine for Google and Facebook, but not for Instagram - my implementations are identical.

                              <LoginSocialInstagram
                                isOnlyGetToken
                                redirect_uri={`${process.env.REACT_APP_STOREFRONT_URL}/social/callback/instagram`}
                                client_id={process.env.REACT_APP_INSTAGRAM_APP_ID || ''}
                                client_secret={process.env.REACT_APP_INSTAGRAM_APP_SECRET || ''}
                                onResolve={({ provider, data }: IResolveParams) => {
                                    console.log('!!!!!!!!!!!!!!!!!!!!!!!');
                                    debugger
                                    this.saveSocialToken(provider, data);
                                }}
                                onReject={(err: any) => {
                                  console.error(err)
                                }}
                              >
                                <InstagramLoginButton className="rounded-4">
                                    <span>Connect Instagram</span>
                                </InstagramLoginButton>
                              </LoginSocialInstagram>

For Facebook and Google the host window calls the onResolve