Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add the signature in the deliveryInfo message posted to the fron… #107

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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