You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If `bodyHash` is provided, it must match a hash of the POST request body.
334
-
if(
335
-
req.method==="POST"&&
336
-
payload?.bodyHash&&
337
-
payload.bodyHash!==hashRequestBody(req)
338
-
){
339
-
error=
340
-
"The request body does not match the hash in the access token. See: https://portal.thirdweb.com/engine/features/keypair-authentication";
341
-
throwerror;
334
+
if(req.method==="POST"&&payload?.bodyHash){
335
+
constcomputedBodyHash=hashRequestBody(req);
336
+
if(computedBodyHash!==payload.bodyHash){
337
+
error=`The request body does not match the hash in the access token. See: https://portal.thirdweb.com/engine/v2/features/keypair-authentication. [hash in access token: ${payload.bodyHash}, hash computed from request: ${computedBodyHash}]`;
338
+
throwerror;
339
+
}
342
340
}
343
341
344
342
const{ isAllowed, ip }=awaitcheckIpInAllowlist(req);
0 commit comments