Webhook Invalid signature

Hi there,
I’m trying to test my code but the webhook returns as Invalid signature error.
I tried using another account and it’s working perfectly (Status:201) I don’t understand why my main account get’s Invalid signature error.

I’m using nestjs

@Post('/webhook')
  async patreonWebhook(@Headers() headers: any, @Body() body: WebhookBodyDto) {
    await this.setPatreonKeys();
    const signature = headers['x-patreon-signature'];

    const verified = computeHash(this.patreonWebhookSecret, body) === signature;
    if (!verified) {
      logger('error', {
        message: 'Invalid signature',
        signature,
        secret: this.patreonWebhookSecret,
        body,
      });
      throw new BadRequestException('Invalid signature');
    }
}

import * as crypto from 'crypto';

export const computeHash = (secret, payload) => {
  const str = JSON.stringify(payload);

  const md5Hasher = crypto.createHmac('md5', secret);
  return md5Hasher.update(str).digest('hex');
};

If the other account is working fine, then its likely that something is happening with this account. Make sure that all your stuff (from clients to calls etc that you are using) are v2. If there is any code that deals with v1 in your code, it may complicate things and cause inconsistencies - even if unlikely in the case of a webhook.

Signature calculation may be going wrong somewhere. Trying to manually deconstruct it may help you catch the culprit.