Hi there,
In my web3 - React application, when I redirect the user to the homepage after logging in, I get an invalid session token error and the data is not loaded. When I refresh the page, the data is loaded. What is the reason of this? I am using a self hosted parse server and the authenticate process is as follows. Normally, the user does not need to be logged in to see the data on the homepage, but when the user navigates to the homepage after login, the page is blank and session errors are occuring on the log.
let provider1 = 'metamask'
let authUser;
try {
await enableWeb3({ throwOnError: true, provider1 });
const { account, chainId } = Moralis;
const { message } = await Moralis.Cloud.run('requestMessage', {
address: account,
chain: parseInt(chainId, 16),
network: 'evm',
});
//reset authenticate to avoid error
authUser = await authenticate({ signingMessage: message, throwOnError: true });```