Skip to content

Commit

Permalink
Merge pull request #1953 from Web3Auth/fix/specify-modalconfig-breaks
Browse files Browse the repository at this point in the history
Fix specifing modalConfig causes initError + update web3auth base hook interface in hook base package
  • Loading branch information
chaitanyapotti authored Sep 19, 2024
2 parents b6862b3 + a0b59c3 commit 3a9433d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/base/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ import { CustomChainConfig } from "../chain/IChainInterface";
import { IPlugin } from "../plugin";

export interface IBaseWeb3AuthHookContext {
isInitialized: boolean;
isInitializing: boolean;
initError: unknown;
isConnected: boolean;
isConnecting: boolean;
connectError: unknown;
provider: IProvider | null;
userInfo: Partial<AuthUserInfo> | null;
isMFAEnabled: boolean;
isInitialized: boolean;
status: ADAPTER_STATUS_TYPE | null;
enableMFA(params?: LoginParams): Promise<void>;
logout(params?: { cleanup: boolean }): Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion packages/modal/src/modalManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
},
};
if (!params?.modalConfig) params = { modalConfig: {} };
const localSmsOtpEnabled = params.modalConfig[WALLET_ADAPTERS.AUTH]?.loginMethods?.[LOGIN_PROVIDER.SMS_PASSWORDLESS].showOnModal;
const localSmsOtpEnabled = params.modalConfig[WALLET_ADAPTERS.AUTH]?.loginMethods?.[LOGIN_PROVIDER.SMS_PASSWORDLESS]?.showOnModal;
if (localSmsOtpEnabled === true && smsOtpEnabled === false) {
throw WalletInitializationError.invalidParams("must enable sms otp on dashboard in order to utilise it");
}
Expand Down

0 comments on commit 3a9433d

Please sign in to comment.