HMAC failure Remix app

Solved

HMAC failure Remix app

Ionuts1
Shopify Partner
24 1 3

Hi guys, i've created an app using remix and i'm hosting the app on render hosting company, everything works fine until i did a run for "Run an automated check for common errors" and i'm getting:

Ionuts1_0-1715870103153.png

 

And this is my webhook file:

import { authenticate } from "../shopify.server";
import db from "../db.server";

export const action = async ({ request }) => {
  const { topic, shop, session } = await authenticate.webhook(request);

  switch (topic) {
    case "APP_UNINSTALLED":
      if (session) {
        await db.session.deleteMany({ where: { shop } });
      }
      break;
    case "CUSTOMERS_DATA_REQUEST":
    case "CUSTOMERS_REDACT":
    case "SHOP_REDACT":
    default:
      throw new Response("Unhandled webhook topic", { status: 404 });
  }

  throw new Response();
};

Any tips for fixing this issue? Thanks 

Accepted Solution (1)

Ionuts1
Shopify Partner
24 1 3

This is an accepted solution.

i've found the solution:

case "CUSTOMERS_DATA_REQUEST":
      break;
    case "CUSTOMERS_REDACT":
      break;
    case "SHOP_REDACT":
      break;
    default:
      throw new Response("Unhandled webhook topic", { status: 404 });

 

View solution in original post

Reply 1 (1)

Ionuts1
Shopify Partner
24 1 3

This is an accepted solution.

i've found the solution:

case "CUSTOMERS_DATA_REQUEST":
      break;
    case "CUSTOMERS_REDACT":
      break;
    case "SHOP_REDACT":
      break;
    default:
      throw new Response("Unhandled webhook topic", { status: 404 });