I am using Morallis self hosted server. Previously authentication process was working fine. But from today I am getting:
error: āMoralis auth failed, invalid data Errorā
status: 404
for API: /server/users
I am using authentication code as per the documentation.
Code:
setLoading(true)
if(!Boolean(window.ethereum && window.ethereum.isMetaMask)){
throw setError(āPlease install metamask.ā)
}
await enableWeb3({ throwOnError: true, provider:'metamask' });
const { account, chainId } = Moralis;
if (!account) {
throw new Error('Connecting to chain failed, as no connected account was found');
}
if (!chainId) {
throw new Error('Connecting to chain failed, as no connected chain was found');
}
const { message } = await Moralis.Cloud.run('requestMessage', {
address: account,
chain: chainId===parseInt(chainId, 16),
networkType: 'evm',
});
let _user = await authenticate({
signingMessage: message,
throwOnError: true,
})
}
Metamask pop-up screenshot:
Here we can see that expiration time is less than issue time.