Skip to content

Commit fea3d7a

Browse files
committed
update message and add logging
1 parent c08f0ae commit fea3d7a

File tree

1 file changed

+8
-3
lines changed
  • functions/zoom-meeting-webhook-handler

1 file changed

+8
-3
lines changed

functions/zoom-meeting-webhook-handler/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ const ZOOM_SECRET =
1717

1818
const handler = async function (event, context) {
1919
try {
20-
const message = `v0:${
21-
event.headers['x-zm-request-timestamp']
22-
}:${JSON.stringify(event.body)}`;
20+
const message = `v0:${event.headers['x-zm-request-timestamp']}:${event.body}`;
2321

2422
const hashForVerify = crypto
2523
.createHmac('sha256', ZOOM_SECRET)
@@ -28,6 +26,13 @@ const handler = async function (event, context) {
2826

2927
const signature = `v0=${hashForVerify}`;
3028

29+
console.log('message');
30+
console.log(message);
31+
console.log('signature');
32+
console.log(signature);
33+
console.log('x-zm-signature');
34+
console.log(event.headers['x-zm-signature']);
35+
3136
if (event.headers['x-zm-signature'] !== signature) {
3237
console.log('Unauthorized', event);
3338
return {

0 commit comments

Comments
 (0)