Moralis user is showing null after i am using web3modal to connect the user

I’m using web3connect button to connect the wallet from the Moralis but i want to use the connected user address, how can i get the connected user address

On the connected user it’s showing i’m connected with the wallet
image

But i get null in the user array

const { web3, isWeb3Enabled, user } = useMoralis();
    console.log(isWeb3Enabled);
    if (isWeb3Enabled) {
        console.log(user); //It's showing null

    }

How can i retrieve the connected user details

you mean the address from the wallet? that is something different, it is not current user

I want to get the current user address but my user array is null despite i’m connected.

How can i get the connected wallet address?

Somewhere from that web3 object you should be able to get the address

So what does the user object do? Isn’t the user about the current user who is connected to my dapp?

It is the authenticated user, not necessarily the user that has the same wallet address form that web3 object.

1 Like