I’m using moralis to authenticate my users on my website using the code below. The metamask windows pops up, I first get the message to connect and then have to sign a tx to authenticate so this flow is working as expected.
When I sign the transaction and I take a look at my react tools, the moralis provider stays at isAuthenticating= true and isWeb3EnableLoading = true. The provider is never updated to isAuthenticated = true and isWeb3Enabled = true.
The account does get updated to the correct address.
This in turn is messing up my useEffect because it uses isAuthenticated as a dependency.
What could be the reason that the provider stays in the isAuthenticating state?
This is my authentication code:
const enableAndAuthenticateMetamask = async () => {
await authenticate({ signingMessage: 'Connect' });
const currentUser = Moralis.User.current();
const currentAddress = await currentUser?.get('ethAddress');
setWallet(currentAddress);
};