I am still trying to figure out how to get an user data from a client-side in conjunction with Moralis version2. The code below works fine in ver1. But how can I modify this code when it comes to version2? I couldnât find the doc that describes âqueryâ ussr data. Would anybody explain me the missing parts?
async function getCurrentUser() {
const user = Moralis.User.current();
if (user) {
console.log("Logged in user:", user);
console.log(user.get("ethAddress"));
} else {
console.log("No user is currently logged in.");
}
}
getCurrentUser();