Skip to content

Commit

Permalink
fix: allow explicitly disabling web3auth
Browse files Browse the repository at this point in the history
  • Loading branch information
aramalipoor committed Dec 23, 2022
1 parent afd1be9 commit c3e3537
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/connectors/src/base/web3auth-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export interface Web3AuthOptions extends OpenLoginOptions {
*/
clientId: string;

/**
* Disable web3auth modal
*/
disabled?: boolean;

/**
* ChainId in hex/number that you want to connect with.
*/
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/core/wallet/providers/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ export const WalletProvider = ({
appLogo: 'https://app.flair.dev/logo-light-filled.png',
};

const web3AuthConfigured = Boolean(web3AuthOptions?.clientId);
const web3AuthConfigured = Boolean(
web3AuthOptions?.clientId && !web3AuthOptions?.disabled,
);
const finalWeb3AuthOptions: Web3AuthOptionsOriginal = deepmerge(
web3AuthOptions || {},
{
Expand Down

0 comments on commit c3e3537

Please sign in to comment.