a-tokyo / react-apple-signin-auth

 Apple signin for React using the official Apple JS SDK

Home Page:https://a-tokyo.github.io/react-apple-signin-auth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught in promise error when closing apple sign in

jacqueswho opened this issue · comments

Hi

Im trying to catch the error 'popup_closed_by_user' when the you user closes the apple sign in. but the onError does not get called and I see there is an uncaught promise error. see image below

image

try {
      appleAuthHelpers.signIn({
        authOptions: {
          clientId: config.apple.clientId,
          /** Requested scopes, seperated by spaces - eg: 'email name' */
          scope: 'email name',
          /** Apple's redirectURI - must be one of the URIs you added to the serviceID - the undocumented trick in apple docs is that you should call auth from a page that is listed as a redirectURI, localhost fails */
          redirectURI: config.baseUrl,
          /** Nonce */
          nonce: nonce.current,
          usePopup: true,
        },
        onSuccess: onAppleSuccess,
        onError: (error: unknown) => console.info('error', error),
      });
    } catch (errorCaught) {
      console.info('errorCaught', errorCaught);
    }`