If you change the account connected in the metamask. Dapp still recognizes the old user because of some information stored in the local storage.
It seems like the account should be disconnected by default whenever such action happens.
If you change the account connected in the metamask. Dapp still recognizes the old user because of some information stored in the local storage.
It seems like the account should be disconnected by default whenever such action happens.
I think that you could add this logic in your code if you want, like logging out the user if the metamask account is changed.
The user that is logged in on Moralis server will keep that session until logout will be made, you can choose to link the new metamask account with current user (if the user wants) too.
Actually its not clear how can I do it with moralis.
The usual way without moralis is to register callback functions like this:
ethereum.on("accountsChanged", doSomething);
ethereum.on("chainChanged", doSomething);
But with moralis, it seems I donβt have access to ethereum object?