Self hosted Moralis V1, how to use wallet connect v2 with vanilla js

      if (method === 'POST' && url === 'functions/getServerTime') {
        return Promise.resolve({
          result: null,
        });
      }

what did getServerTime cloud function return?

did the authentication work before without wallet connect?

Yes, it works perfectly with metamask

getServerTime returned this {ā€œresultā€:null}

what is the difference in the auth request that you see in network tab when you use metamask vs when you use wallet connect?

did you increase the timeout to 90 seconds from the default of 15 seconds for Auth API?

hereā€™s the full code

and no i havenā€™t updated anything in the parse-server-migration

I am just trying to make the basic functionnality working

check the network tab to see what it is sent to the server, to see if it is a difference between when it works with metamask and when it doesnā€™t work with wallet connect.

sometimes it doesnā€™t work with wallet connect because it takes longer than 15 seconds sometimes to sign the message with wallet connect and that is why it will help to change that timeout value in the parse server code for Auth API

Yes, when i auth using metamask, all the request to the server are perfect, including the ā€œserver/usersā€ the OPTIONS and the POST, with metamask the OPTIONS is done, but the POST request is not found

hereā€™s the code to how I do it with metamask

i tried playing with the code, but nothing worked

and i donā€™t know how to increase the AUTH API timeout

and btw, the whole auth request, with or without the error doesnā€™t take more than 1 second so I doubt to be the timeout issue

it is not the timeout for how fast the request is, is the timeout that it takes from when you request a message to sign until you sign the message and send the signature back to the server

if you sign the message fast enough, then it works?

Not at all, it doesnā€™t work, also I just updated it from 15 seconds to 90 seconds, and still not working

check the network tab to see what it happens, you can check the exact request that is made to the server, it is a http request with the message and the signature

the message that you sign with wallet connect has the same format as the message that you sign with metamask?

i donā€™t send a signinMessage in the wallet connect code, but I do it when I do it with metamask as shown in the code above,

the reason is that the example you sent, they also donā€™t do any signing message

just like this:

but when do it with metamask the code is this:

const { message } = await Moralis.Cloud.run(ā€œrequestMessageā€, { address: account, chain: parseInt(chainId, 16), network: ā€œevmā€, })const result = await Moralis.authenticate({ signingMessage: message, throwOnError: true, })

Try to change the code to also get the message to sign when you use wallet connect, similar to how you do it with MetaMask

and signmessage data would be similar to the one of metamask?

Yes, the message to be signed should have the same format as the one that you sign with MetaMask

Just did it, now thereā€™s a different issue, i scan the code it shows me the page to confirm but never shows the page to sign