Skip to content

Commit

Permalink
Merge pull request #107 from bosonprotocol/missing-signature-delivery…
Browse files Browse the repository at this point in the history
…-info-message-to-frontend

fix: add the signature in the deliveryInfo message posted to the fron…
  • Loading branch information
levalleux-ludo committed Dec 20, 2023
2 parents b438feb + 3bf60d3 commit 54bd75a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ <h2>Redemption Widget</h2>
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 )
Expand Down
5 changes: 3 additions & 2 deletions src/components/widgets/redeem/Redeem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 54bd75a

Please sign in to comment.