Moralis provider stays at isAuthenticating state

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);
  };

Can we see your component code and how you’re using useEffect and useMoralis?

this looks like vanilla js syntax.

Can you add some logging with console.log(JSON.stringify(currentUser)) ?

Try replacing the code quoted with this

    const currentUser = await authenticate({ signingMessage: "Connect" });;
    const currentAddress = currentUser?.get("ethAddress");

As @cryptokid mentioned, the syntax is a vanillaJs way and won’t work properly because there’s a user variable from the hook and the hook works in sync