Skip to content

Commit

Permalink
fix: close OAuth popup from parent (#973)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dphilipson authored Sep 20, 2024
1 parent d3b6777 commit b67844c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions account-kit/signer/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ export class AlchemySignerWebClient extends BaseSignerClient<ExportWalletParams>
const { alchemyBundle: bundle, alchemyOrgId: orgId } = event.data;
if (bundle && orgId) {
cleanup();
popup?.close();
this.completeAuthWithBundle({
bundle,
orgId,
Expand Down

0 comments on commit b67844c

Please sign in to comment.