Skip to content

Commit

Permalink
Set default auth mode to prevent double popup (#4274)
Browse files Browse the repository at this point in the history
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## 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}`

<!-- end pr-codex -->
  • Loading branch information
gregfromstl committed Aug 24, 2024
1 parent 1405598 commit a0aea23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-badgers-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Fix popup and window auth modes conflicting on firefox
2 changes: 2 additions & 0 deletions packages/thirdweb/src/wallets/in-app/core/wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export async function connectInAppWallet(
connector: InAppConnector,
): Promise<[Account, Chain]> {
if (
// if auth mode is not specified, the default is popup

Check warning on line 43 in packages/thirdweb/src/wallets/in-app/core/wallet/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/wallets/in-app/core/wallet/index.ts#L43

Added line #L43 was not covered by tests
createOptions?.auth?.mode !== "popup" &&
createOptions?.auth?.mode !== undefined &&

Check warning on line 45 in packages/thirdweb/src/wallets/in-app/core/wallet/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/wallets/in-app/core/wallet/index.ts#L45

Added line #L45 was not covered by tests
connector.authenticateWithRedirect
) {
const strategy = options.strategy;
Expand Down

0 comments on commit a0aea23

Please sign in to comment.