WalletLoginError: Custom. User has already enabled mfa, please use the @web3auth/web3auth-web sdk for login with mfa
at Function.fromCode (/home/ec2-user/Web3-FanTv/node_modules/@web3auth/base/dist/base.cjs.js:416:12)
at Web3Auth. (/home/ec2-user/Web3-FanTv/node_modules/@web3auth/node-sdk/dist/Web3Auth.js:58:47)
at Generator.next ()
at fulfilled (/home/ec2-user/Web3-FanTv/node_modules/@web3auth/node-sdk/dist/Web3Auth.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 5000
}
I am using custom Provider , along with Node Sdk, @web3auth/node-sdk ( after 1000+ logins now it is throwing error ) :-> Tried switching to “@web3auth/single-factor-auth” unable to connect
it throws error : WalletInitializationError: Invalid params passed in, provider should have chainConfig and should be intiliazed with chainId and chainNamespace
const { Web3Auth } = require(“@web3auth/single-factor-auth”);
const { EthereumPrivateKeyProvider } = require(“@web3auth/ethereum-provider”);
const provider = new EthereumPrivateKeyProvider({
config: {
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: “0x13881”, // Chain ID for Mumbai testnet
rpcTarget: “https://rpc-mumbai.maticvigil.com”, // Mumbai testnet RPC endpoint
displayName: “Polygon Mumbai Testnet”, // Display name for the network
blockExplorer: “https://mumbai.polygonscan.com/”, // Mumbai testnet block explorer
ticker: “MATIC”, // Ticker symbol for the testnet token
tickerName: “MATIC”, // Ticker name for the testnet token
},
},
});
const web3auth = new Web3Auth({
clientId: process.env.WEB3_AUTH_CLIENT_ID, // Get your Client ID from Web3Auth Dashboard
web3AuthNetwork: “testnet”, // Available networks are “testnet”, “mainnet”, “cyan”, “aqua”.
usePnPKey: false, // Setting this to true returns the same key as PnP Web SDK, By default, this SDK returns CoreKitKey.
enableLogging:true
});
web3auth.init({ provider });