Sign in with appleJS firing twice on iphone

One of our QA testers reported that when attempting to sign in with apple on our site, the prompt would pop up, he would sign in, it would spin, say success... and then pop up again, after that it would work properly.

No one has been able to reproduce so far, so maybe it's a specific thing, but in order to provide accurate responses to our users we would like to know if there's a way to fix or avoid this

The solution is entirely copied from this documentation

Sign in with appleJS firing twice on iphone
 
 
Q