TypeError: Moralis.User.logout is not a function

Hi, Iā€™m getting

TypeError: Moralis.User.logout is not a function

Whenever I click my logout button. Code below.

async function logoutAccount() {
        console.log("Logging out");
        await Moralis.User.logout();
    }

I followed this snippet in one of the tutorials like this https://docs.moralis.io/guides/build-a-simple-dap-in-3-mins-login-part-2

Hoping someone can point me in the right direction.

Seems like it is .logOut(), not .logout()

Well that was embarassing. It works now! Thank you.

However, I thought that the web3 connection will also get killed along with it? Is there a way to logout and also kill all the web3 connections so the code no longer has access to the account and addresses?

Thank you

1 Like

Disconnect a web3 wallet [Solved] this thread might be helpful