Skip to content

Commit

Permalink
fix: add the signature in the deliveryInfo message posted to the fron…
Browse files Browse the repository at this point in the history
…tend
  • Loading branch information
levalleux-ludo committed Dec 20, 2023
1 parent b438feb commit 3bf60d3
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 3bf60d3

Please sign in to comment.