react-apple-login icon indicating copy to clipboard operation
react-apple-login copied to clipboard

Popup doesn't close and call callback after a successfull authorization attempt

Open arjendevos opened this issue 3 years ago • 4 comments

return (
    <AppleLogin
      clientId="com.webridge.half5.web"
      redirectURI="https://app.half5.com/apple/callback"
      responseMode="form_post"
      responseType="code"
      callback={(res) => {
        console.log({ res });

        if (
          res.error &&
          res.error.error &&
          res.error.error.includes('popup_blocked_by_browser')
        ) {
          return globalToast({
            message: global.translate({
              nl: 'Sta popup toe',
              en: 'Allow popup',
            }),
          });
        }
      }}
      usePopup
      // autoLoad
      render={(renderProps) => (
        <AppleButton isLoading={false} onPress={renderProps.onClick} />
      )}
    />

Everything works fine until i click on continue. Popup opens, i can enter my email etc.

I check the response with Inspect Element and it does return a succesfull response with Authorization Code and ID Token. But nothing happens UI wise.

After i click the second time this happens:

Screenshot 2022-10-28 at 13 31 27

arjendevos avatar Oct 28 '22 11:10 arjendevos

facing the same issue

deluxanmariathasan avatar Dec 02 '22 05:12 deluxanmariathasan

Did you find any solution how to fix it ?

sewign avatar Dec 23 '22 11:12 sewign

facing the same issue..

dev-vasanth avatar Dec 23 '22 11:12 dev-vasanth

The redirectURI has to start with "https://".

Also make sure the redirectURI matches correctly with the page that opened the popup.

chrishawn avatar Feb 25 '23 20:02 chrishawn