Authentication Function Help

For some reason, setAuthenticationChecker and setVisibleModal aren’t updating once the user is finished authenticating. Can’t figure out why

function WalletConnectAuthentication() {
setVisibleModal(true);
setLoadingMessage(“Authenticating through WalletConnect.”)
Moralis.Web3.getSigningData = () => ‘Welcome to SpacePath Marketplace! Please sign in to create an account.’;
Moralis.Web3.authenticate().then(function (user) {
setAuthenticationChecker(false);
setVisibleModal(false);
})
};

serverURL: https://4nunoqoexvrk.usemoralis.com:2053/server

Hey @thutch

Moralis.Web3.authenticate({ provider: "walletconnect" }).then((user) => {
      console.log(user);
}); 

I’ve tested and it works correctly. Could you provide your full code?

Changed it to an arrow function after the .then and it worked. Thanks!

1 Like