I'm implementing web3 authentication using sign message and verify message. On my client side i have following code:

 const timestamp = Math.floor(Date.now() / 1000)
  const message = `Current time ${timestamp}`
  const signedMessage = await signer.signer.signMessage(message)
  await axios.post(`${config.BACKEND_URL}/inventory/verify`, {
    address, signedMessage

And on my backend i'm executing:

public async verify(data) {
   const { message, address, signature } = data;

   const _address = utils.verifyMessage(message, signature)

but when util.verifyMessage get called i receive this error:

TypeError: Cannot read property 'r' of undefined any idea why it's happening? First time doing these operations sorry ;s


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.