Moralis error when connecting walletconnect on mobile browser

Hi,
When i try to connect wallet with walletconnect on mobile browser, it returns error like this:

error: Moralis auth failed, invalid data: Moralis SDK Core Error: [C0006] Request failed, Bad Request(400): Challenge not found, Timeout may have exceeded {“code”:101,“stack”:“Error: Moralis auth failed, invalid data: Moralis SDK Core Error: [C0006] Request failed, Bad Request(400): Challenge not found, Timeout may have exceeded\n at /var/app/current/build/auth/MoralisEthAdapter.js:34:15\n at runMicrotasks ()\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Promise.all (index 0)”}

But when I try to connect Walletconnect with private mode in mobile browser, the connection works successfully. What is the reason? What should i change for works on normal mode in mobile?

Can you let us know what do you mean by this?

Also what is the code that is throwing that error. How are you using it now?

When I enter my react web dapp application from a mobile device, I get this error when I try to login with walletconnect. I don’t have the same problem on web and mobile in incognito mode.

What timeout value did you use in your request message params?

In case you used a lower number, try updating it to 60 seconds

I updated to 60 seconds but still same error.
Moralis SDK Core Error: [C0006] Request failed, Bad Request(400): Challenge not found, Timeout may have exceeded


const DOMAIN =  process.env.DOMAIN || '';
const STATEMENT = 'Please sign this message to confirm your identity.';
const URI = process.env.APPLICATION_URL || '';
const EXPIRATION_TIME = '2024-01-01T00:00:00.000Z';
const TIMEOUT = 60;

export async function requestMessage({
  address,
  chain,
  networkType,
}: {
  address: string;
  chain: string;
  networkType: 'evm';
}) {
  const result = await Moralis.Auth.requestMessage({
    address,
    chain,
    networkType,
    domain: DOMAIN,
    statement: STATEMENT,
    uri: URI,
    expirationTime: EXPIRATION_TIME,
    timeout: TIMEOUT,
  });

  const { message } = result.toJSON();

  return message;
}

Is the login process with walletconnect mobile taking more than 60 seconds?

The maximum timeout that you can use is 120 second. Maybe you can try with this.

Actually process taking less than 60 seconds but I increased it to 120 and take a same error now. The interesting thing is that there is no problem in incognito mode in the mobile browser. The problem only happens in normal mode on mobile.

Do you have any caching for your API endpoints? That would explain why it worked in incognito.