I am having an error on the connecting metamask to my front-end. Before there was no error.
Here is my code
// metamask connection
const { authenticate, isAuthenticated, account, logout } = useMoralis();
const { switchNetwork, chainId } = useChain();
const [walletValue, setwalletValue] = useState('');
const [connectButton, setconnectButton] = useState(false);
const [openBsc, setOpenBsc] = useState(false);
const [haveEmoji, setHaveEmoji] = useState(false);
const [search] = useSearchParams();
// // network change
// network change
useEffect(() => {
if (isAuthenticated) {
if (chainId) {
if (chainId === '0x38') {
setwalletValue(account);
setPasteText('');
setconnectButton(true);
setOpenBsc(false);
setTestpermission(false);
} else {
setconnectButton(false);
setwalletValue('');
}
}
} else {
setconnectButton(false);
setwalletValue('');
}
}, [isAuthenticated, chainId, account, switchNetwork]);
const login = async () => {
if (!isAuthenticated) {
await authenticate({ signingMessage: 'Register to Arcus' });
console.log('dsadasd');
console.log(account);
switchNetwork('0x38');
} else {
await logout();
}
};
The error
POST https://ni94byhkt2ko.usemoralis.com:2053/server/users net::ERR_NAME_NOT_RESOLVED