From 3bf60d3976f5d3fef07df21e3b99e9f8426bde13 Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Wed, 20 Dec 2023 14:47:13 +0000 Subject: [PATCH] fix: add the signature in the deliveryInfo message posted to the frontend --- public/example.html | 2 +- src/components/widgets/redeem/Redeem.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/example.html b/public/example.html index b5d0c73..b136863 100644 --- a/public/example.html +++ b/public/example.html @@ -264,7 +264,7 @@

Redemption Widget

window.addEventListener("message", (event) => { if (event.data.type === constants.deliveryInfoMessage) { console.log( - `Received message '${event.data.type}' from '${event.origin}'. Content: '${JSON.stringify(event.data.message)}'` + `Received message '${event.data.type}' from '${event.origin}'. Content: '${JSON.stringify(event.data.message)}' Signature: '${event.data.signature}'` ); if (getValue('input-wait-for-response', 'checked')) { // wait for a bit and send a response to the iFrame (only relevant when ) diff --git a/src/components/widgets/redeem/Redeem.tsx b/src/components/widgets/redeem/Redeem.tsx index 8cc5d31..f29da05 100644 --- a/src/components/widgets/redeem/Redeem.tsx +++ b/src/components/widgets/redeem/Redeem.tsx @@ -152,11 +152,12 @@ export function Redeem() { }} deliveryInfoHandler={ targetOrigin - ? async (message) => { + ? async (message, signature) => { try { const event = { type: "boson-delivery-info", - message + message, + signature }; // precaution: register to the response before posting the message const responseType = "boson-delivery-info-response";