Hi, I’m trying to verify the hmac value in my oauth flow, I’m based in this section https://shopify.dev/apps/auth/oauth/getting-started#step-7-verify-a-request, but, when I try to match the value generated with hmac, the values aren’t the same result
function verifyRequest(req, res, next) {
const {code, shop, timestamp} = req.query
const message = `code=${code}&shop=${shop}×tamp=${timestamp}`
const generated_hash = crypto.createHmac('SHA256', apiSecret).update(message).digest('hex')
if (generated_hash === req.query.hmac) {
next()
} else {
const error = new Error(`The request verification is not successful`)
error.status = 400
error.type = 'expected'
throw error
}
}
