Skip to content

Commit

Permalink
check origin before checking type of postMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
MAX-786 committed Jun 30, 2024
1 parent 50ce5fe commit 93f5431
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/hydra-js/hydra.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class Bridge {

onEditChange(callback) {
this.realTimeDataHandler = (event) => {
if (event.data.type === 'FORM_DATA') {
if (event.origin === this.adminOrigin) {
if (event.origin === this.adminOrigin) {
if (event.data.type === 'FORM_DATA') {
if (event.data.data) {
callback(event.data.data);
} else {
Expand Down

0 comments on commit 93f5431

Please sign in to comment.