Prevent subscription recipient from connecting to unverified web3 account

This commit is contained in:
silverpill 2022-05-25 22:14:15 +00:00
parent fe6ef494e3
commit c2b0c67be9

View file

@ -130,6 +130,12 @@ async function connectWallet() {
if (!signer) { if (!signer) {
return return
} }
const walletAddress = await signer.getAddress()
if (isCurrentUser() && !ethereumAddressMatch(walletAddress, profileEthereumAddress)) {
// Recipient must use verified account
disconnectWallet()
return
}
const walletChainId = await web3Provider.send("eth_chainId", []) const walletChainId = await web3Provider.send("eth_chainId", [])
console.info("chain ID:", walletChainId) console.info("chain ID:", walletChainId)
web3Provider.provider.on("chainChanged", (chainId: string) => { web3Provider.provider.on("chainChanged", (chainId: string) => {