Hey guys Im having a super weird issue, I was following Filip’s DEX tutorial last night, then decided to continue in the morning. Now for some reason the MetaMask authentication isnt working anymore. I didnt change any code at all and the Sign In was working last night. Any idea what it could be related to?
Here is the code:
<button id = "login_button" class="btn btn-outline-success my-2 my-sm-0" type="submit">Sign In With MetaMask </button>
Moralis.initialize("wypjz1fiduIZyLQMpG43zuCg8iMlQUrNUH2S7Gfg"); // Application id from moralis.io
Moralis.serverURL = "https://iloef8srg7hm.grandmoralis.com:2053/server"; //Server url from moralis.io
async function login() {
try {
currentUser = Moralis.User.current();
if(!currentUser){
currentUser = await Moralis.Web3.authenticate();
}
} catch (error) {
console.log(error);
}
}
document.getElementById("login_button").onclick = login;