From a0aea23e74ffce4cd20842603efa87a5c038feb8 Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Sat, 24 Aug 2024 21:08:40 +0000 Subject: [PATCH] Set default auth mode to prevent double popup (#4274) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem solved Short description of the bug fixed or feature added --- ## PR-Codex overview This PR fixes a conflict between popup and window authentication modes on Firefox. ### Detailed summary - Set the default authentication mode to "popup" if not specified - Ensure popup authentication mode is used when not explicitly defined > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .changeset/tame-badgers-drum.md | 5 +++++ packages/thirdweb/src/wallets/in-app/core/wallet/index.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/tame-badgers-drum.md diff --git a/.changeset/tame-badgers-drum.md b/.changeset/tame-badgers-drum.md new file mode 100644 index 00000000000..b7d293b64f8 --- /dev/null +++ b/.changeset/tame-badgers-drum.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fix popup and window auth modes conflicting on firefox diff --git a/packages/thirdweb/src/wallets/in-app/core/wallet/index.ts b/packages/thirdweb/src/wallets/in-app/core/wallet/index.ts index ce72a591ecf..748d790759b 100644 --- a/packages/thirdweb/src/wallets/in-app/core/wallet/index.ts +++ b/packages/thirdweb/src/wallets/in-app/core/wallet/index.ts @@ -40,7 +40,9 @@ export async function connectInAppWallet( connector: InAppConnector, ): Promise<[Account, Chain]> { if ( + // if auth mode is not specified, the default is popup createOptions?.auth?.mode !== "popup" && + createOptions?.auth?.mode !== undefined && connector.authenticateWithRedirect ) { const strategy = options.strategy;