Hey
The app uses Web3Auth and Polygon for authentication, but then I need to switch the chain to Ethereum, Iâm doing this programmatically and it works fine because I can switch the chain in Metamask
`import { useMoralis } from âreact-moralisâ;
.
.
.
const { provider } = useMoralis();
if (provider) {
try {
await provider.request({
jsonrpc: â2.0â,
method: âwallet_switchEthereumChainâ,
params: [
{
chainId: â0x1â,
},
],
});
} catch (error) {
console.error(error);
}
}`
But I have a useEffect
to watch the chainId
from Moralis, and itâs 0x1 for a few seconds and then changes to 0x87 Polygon.
Why does the chainId change if in my Metamask is Ethereum set?
Is there another way to change the chain using web3auth as an authenticator?