Uncaught in promise error when closing apple sign in
jacqueswho opened this issue · comments
Jacques Nel commented
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
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);
}`
Ahmed Tarek commented
Thanks for opening the issue! It's fixed now.
#74
https://github.com/A-Tokyo/react-apple-signin-auth/releases/tag/1.0.7
Ahmed Tarek commented
The onError function now gets called when window.AppleID.auth.signIn()
throws an error.