File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 11import { iframeStyles } from "../styles/styles" ;
2+ import { verificationUrl } from "../helpers/defaultConfig" ;
3+
24import { ORBA_ONE_MESSAGE_CHANNEL , ORBA_ONE_SUCCESS , ORBA_ONE_CANCEL } from "./constants" ;
35
46type State = "loading" | "success" | "error" | "idle" ;
@@ -50,17 +52,20 @@ export function iframeManager(
5052 }
5153
5254 function handler ( event : any ) {
53- const json = JSON . parse ( event . data ) ;
54-
55- if ( json . status === ORBA_ONE_SUCCESS ) {
56- onSuccess ( json ) ;
57- disconnect ( ) ;
58- } else if ( json . status === ORBA_ONE_CANCEL ) {
59- onCancelled ( json ) ;
60- disconnect ( ) ;
61- } else {
62- onError ( json ) ;
55+ console . log ( event )
56+ if ( event . origin != verificationUrl ) {
57+ const json = JSON . parse ( event . data )
58+ if ( json . status === ORBA_ONE_SUCCESS ) {
59+ onSuccess ( json ) ;
60+ disconnect ( ) ;
61+ } else if ( json . status === ORBA_ONE_CANCEL ) {
62+ onCancelled ( json ) ;
63+ disconnect ( ) ;
64+ } else {
65+ onError ( json ) ;
66+ }
6367 }
68+
6469 }
6570
6671 return {
@@ -73,7 +78,7 @@ export function iframeManager(
7378 state = "loading" ;
7479 onChange ( state ) ;
7580 document . body . appendChild ( iframe ) ;
76- window . addEventListener ( ORBA_ONE_MESSAGE_CHANNEL , handler , false ) ;
81+ window . addEventListener ( ORBA_ONE_MESSAGE_CHANNEL , handler ) ;
7782 }
7883 } ,
7984
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const iframeStyles = `
2121 left: 0;
2222 width: 100vw;
2323 height: 100vh;
24+ height: -webkit-fill-available;
2425 border: none;
2526` ;
2627
You can’t perform that action at this time.
0 commit comments