Post

Replies

Boosts

Views

Activity

Reply to Sign in with apple js use popUp
If usePopup is giving you problems, a workaround is to bypass the Apple JS SDK and open the pop-up manually. When I did this, clicking on "Continue" after the user verified their credentials redirected the pop-up to my redirect uri, regardless of whether or not the popup and redirect uri were on different subdomains. Here's the sample code that gets called whenever a user clicks on my "Sign In With Apple" button: const handleClick = () => { 				const oauthUrl = `https://appleid.apple.com/auth/authorize?response_type=code&` + 				`client_id=${CLIENT_ID}&scope=name+email&response_mode=form_post&` + 				`state=${STATE}&redirect_uri=${REDIRECT_URI}&nonce=${secureRandomString(32)}` 				const windowWidth = 450 				const windowHeight = 600 				const left = window.screen.width / 2 - windowWidth / 2 				const top = window.screen.height / 2 - windowHeight / 2 				window.open(oauthUrl, 'Apple Sign-In',`menubar=no,location=no,scrollbars=no,status=` + `no,width=${windowWidth},height=${windowHeight},top=${top},left=${left}`)	 		}
Jan ’21
Reply to Stuck in Sign in With Apple modal flow
If usePopup is giving you problems, a workaround is to bypass the Apple JS SDK and open the pop-up manually. When I did this, clicking on "Continue" after the user verified their credentials redirected the pop-up to my redirect uri, regardless of whether or not the popup and redirect uri were on different subdomains. Here's the sample code that gets called whenever a user clicks on my "Sign In With Apple" button: const handleClick = () => { 				const oauthUrl = `https://appleid.apple.com/auth/authorize?response_type=code&` + 				`client_id=${CLIENT_ID}&scope=name+email&response_mode=form_post&` + 				`state=${STATE}&redirect_uri=${REDIRECT_URI}&nonce=${secureRandomString(32)}` 				const windowWidth = 450 				const windowHeight = 600 				const left = window.screen.width / 2 - windowWidth / 2 				const top = window.screen.height / 2 - windowHeight / 2 				window.open(oauthUrl, 'Apple Sign-In',`menubar=no,location=no,scrollbars=no,status=` + `no,width=${windowWidth},height=${windowHeight},top=${top},left=${left}`)	 		}
Jan ’21