I have a React app that connects to the Moralis Server.
I have deleted a session on my Moralis Dashboard, as I was trying to reset (what I thought) was a connection issue.
I have a button in my index.js
<button onClick= {login} >Test button</button>
This runs the login async
async function login() {
let user = Moralis.User.current();
if(!user) {
user = await Moralis.authenticate({signingMessage:"Message"});
}
console.log(user);
alert("You have signed this.", user);
}
Now when I run the app I get the user object in my console, and it runs the alert, but the session is not logged onto the Moralis Dashboard anymore, and it doesn’t load MetaMask anymore.
I also get these two errors in my console
How can I solve this issue?
HOW I SOLVED THIS
I cleared all my cookies in local storage and that of Moralis. Ran the app again and it successfully logged my session to the Moralis DB and also triggered the MetaMask window and signing message.