I'm currently working on web3auth authentication, In their documentation most of the code is in typescript. But I'm using javascript in my Next.js project. I'm using core packages to build custom ui interface. But getting this wallet error when I tried to login using walletAdapters
This is my code for that
const web3AuthCoreCtorParams = {
clientId,
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget:
"https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161", // This is the testnet RPC we have added, please pass on your own endpoint while creating an app
},
};
// creating new web3auth instance
const web3AuthInstance = new Web3AuthCore(web3AuthCoreCtorParams);
subscribeAuthEvents(web3AuthInstance);
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
clientId,
network: "testnet",
uxMode: "redirect",
},
});
web3AuthInstance.configureAdapter(openloginAdapter);
const web3authProvider = await web3AuthInstance.connectTo(
WALLET_ADAPTERS.OPENLOGIN,
{
relogin: true,
loginProvider: "discord",
}
);
setProvider(web3authProvider);
};
And the error I'm getting is
Unhandled Runtime Error
WalletLoginError: Failed to connect with walletFailed to login with openlogin
Call Stack
Function.fromCode
node_modules/@web3auth/base/dist/base.esm.js (315:0)
Function.connectionError
node_modules/@web3auth/base/dist/base.esm.js (320:0)
OpenloginAdapter.connect
node_modules/@web3auth/openlogin-adapter/dist/openloginAdapter.esm.js (141:12)
async Web3AuthCore.connectTo
node_modules/@web3auth/core/dist/core.esm.js (105:0)
I'm using version 1.0.0