Skip to content

Commit

Permalink
fix: postMessage origin check for tlink embedded viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Oct 25, 2024
1 parent 2b40f36 commit d2e2356
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion javascript/card-sdk/src/messaging/PostMessageAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class PostMessageAdapter implements IEngineAdapter {

private async handleMessageResponse(event: MessageEvent) {

if (event.origin !== this.sdk.instanceData.engineOrigin)
if (this.sdk.instanceData.engineOrigin !== "*" && event.origin !== this.sdk.instanceData.engineOrigin)
return;

const params = event.data?.params;
Expand Down
2 changes: 1 addition & 1 deletion javascript/engine-js/src/view/sdk/v1.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export abstract class AbstractViewBinding implements IViewBinding {

console.log("ViewEvent.TOKENS_UPDATED");

this.postMessageToView(event, {oldTokens: tokens, updatedTokens: tokens, cardId: id});
this.postMessageToView(event, {oldTokens: tokens, updatedTokens: tokens, cardId: id, id});

this.hideLoader();
return;
Expand Down

0 comments on commit d2e2356

Please sign in to comment.