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