From b67844cc7e58eec8de00dd4504a8265a588ca2b6 Mon Sep 17 00:00:00 2001 From: David Philipson Date: Fri, 20 Sep 2024 14:10:57 -0700 Subject: [PATCH] fix: close OAuth popup from parent (#973) On iOS, a browser window can't close itself via `window.close()`: instead, it must be closed by the same context that called `window.open` to open it. This means that for iOS we cannot rely on the OAuth callback window to close itself in the popup-based flow. Instead, we'll have the parent close it upon receiving a message. --- account-kit/signer/src/client/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/account-kit/signer/src/client/index.ts b/account-kit/signer/src/client/index.ts index 2c9c52b8c7..47aff23b37 100644 --- a/account-kit/signer/src/client/index.ts +++ b/account-kit/signer/src/client/index.ts @@ -454,6 +454,7 @@ export class AlchemySignerWebClient extends BaseSignerClient const { alchemyBundle: bundle, alchemyOrgId: orgId } = event.data; if (bundle && orgId) { cleanup(); + popup?.close(); this.completeAuthWithBundle({ bundle, orgId,