-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shopify webhook - Failed sha256 verification #769
Comments
Hi @jaaneh, thanks for reporting this! I've just tried to reproduce this with the latest First thing to check would be that the integration and SDK packages are on
Shopify uses the Otherwise, my guess would be the provided To trigger re-registration you can just change the integration ID here: const shopify = new Shopify({
id: "shopify",
...
} |
Hi @nicktrn. Appreciate the reply. I am running I've made sure the I've also tried to re-register it, by appending ... but it seems to still fail the verification. The trigger on Shopify is set to the DEV url from here: with this setup Here is the full code to my app.ts. import express from "express"
import morgan from "morgan"
import { notFound, errorHandler } from "./handlers"
// Trigger
import "./trigger/jobs/shopify"
import { client } from "./trigger"
import { createMiddleware } from "@trigger.dev/express"
const app = express()
app.use(morgan("dev"))
app.use(express.json())
app.use(createMiddleware(client))
app.get("/", (_, res) => res.status(200).send({ status: "ok" }))
app.use(notFound)
app.use(errorHandler)
export default app This is running the exact same job code as the example I gave above. |
Ok, so changing from this app.use(morgan("dev"))
app.use(express.json())
app.use(createMiddleware(client)) // <= ..to this app.use(morgan("dev"))
app.use(createMiddleware(client)) // <=
app.use(express.json()) does the job. I assume the JSON parser is part of the issue. |
Thanks for the detailed walkthrough! No need to be embarrassed, it's not immediately clear why this wouldn't work. It's essentially due to requests from the platform not all having a json That being said, we should document this - don't think there's a workaround apart from adding middlewares that mutate the request only after the client middleware. |
I opened this originally in discussions, but unsure if this is better suited as an issue so re-opening it here. Feel free to close one and continue conversation in the other. Discussion #768
Hey there,
I've been trying to get up an going with the Shopify integration, however every time I trigger an event through Shopify it leads to a "Failed sha256 verification" error.
The webhook succeeds obviously when using the test event in Trigger, and it returns the payload (using the example below). I have set up webhook in Shopify, and I am also using the correct secrets/env vars.
I am self-hosting Trigger, and have input the DEV URL to Shopify as the app is not hosted yet.
Seeing as Shopify doesn't have a way to insert the secret that Trigger gives you, and they instead give us one, I assume Trigger registers this automatically when registering the trigger? Still, with the correct URL set in Shopify it fails to verify.
Here's an example piece of code that doesn't work:
The text was updated successfully, but these errors were encountered: