Open parisetflorian opened 3 months ago
Is this still happening?
@bastienbeurier Yes! I just tested right now. Works fine on chrome but I get this on Safari:
TypeError: null is not an object (evaluating 'this.modal.location = this.url + '&ws_client_id=' + wsClientId')
@parisetflorian What safari version and iOS version/phone are you on?
Hi! I suspect the problem is that this window.open()
call happens in an async context when the AuthorizationModal is instantiated in a Promise.
Most browsers block window.open
if it's not a result of direct user interaction, but Safari iOS is especially strict about it. I've even found it problematic in sync contexts when it was a couple functions deep in a click handler.
Even after a potential fix for the Promise, it might be necessary to educate users about this, which is why some SDKs may provide a controlled button, or allow users to pass a reference to their own button and attach an event listener to it, eg:
const nango = new Nango({ publicKey: '<PUBLIC-KEY>', authButtonId: '<github-login>' });
Triggering the auth workflow on mobile safari won’t open the popup.