File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1616 }
1717 },
1818 "extraDependencies" : {
19- "fast-json-stable-stringify" : " ^2.1.0"
19+ "fast-json-stable-stringify" : " ^2.1.0" ,
20+ "zod" : " ^4"
2021 },
2122 "extraDevDependencies" : {
2223 "@dotenvx/dotenvx" : " ^1.49.0" ,
2324 "react" : " ^19.1.1" ,
2425 "react-dom" : " ^19.1.1" ,
2526 "tsconfig-paths" : " ^4.2.0" ,
26- "ts-node" : " ^10.5.0" ,
27- "zod" : " ^4"
27+ "ts-node" : " ^10.5.0"
2828 },
2929 "extraPeerDependencies" : {
3030 "react" : " ^18 || ^19" ,
Original file line number Diff line number Diff line change 4444 "tsn" : " ts-node -r tsconfig-paths/register"
4545 },
4646 "dependencies" : {
47- "fast-json-stable-stringify" : " ^2.1.0"
47+ "fast-json-stable-stringify" : " ^2.1.0" ,
48+ "zod" : " ^4"
4849 },
4950 "peerDependencies" : {
5051 "react" : " ^18 || ^19" ,
6263 "react" : " ^19.1.1" ,
6364 "react-dom" : " ^19.1.1" ,
6465 "tsconfig-paths" : " ^4.2.0" ,
65- "ts-node" : " ^10.5.0" ,
66- "zod" : " ^4"
66+ "ts-node" : " ^10.5.0"
6767 },
6868 "browser" : {
6969 "fs" : false ,
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export async function verifyWebhookEventSignature(
8181 }
8282
8383 const signature = createWebhookSignature ( {
84- payload : event . data . payload ,
84+ body : event . data , // NOTE: We need to encrypt the entire body, not just the payload
8585 timestamp : evt . timestamp ,
8686 secret : cfg . secret ,
8787 } ) ;
@@ -102,15 +102,15 @@ export async function verifyWebhookEventSignature(
102102 * Creates a webhook signature for the given payload, timestamp, and secret.
103103 */
104104export function createWebhookSignature ( {
105- payload ,
105+ body ,
106106 timestamp,
107107 secret,
108108} : {
109- payload : unknown ;
109+ body : unknown ;
110110 timestamp : string ;
111111 secret : string ;
112112} ) : string {
113- const dump = stringify ( payload ) ;
113+ const dump = stringify ( body ) ;
114114 const message = `${ timestamp } .${ dump } ` ;
115115
116116 const hmac = createHmac ( "sha256" , secret ) ;
You can’t perform that action at this time.
0 commit comments