Skip to content

Commit

Permalink
fix(router): send post message to window.parent instead of window.top…
Browse files Browse the repository at this point in the history
… in external 3ds flow (#5778)
  • Loading branch information
sai-harsha-vardhan authored Sep 3, 2024
1 parent e3a9fb1 commit f9b489a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/router/src/core/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,15 +1240,15 @@ pub fn get_html_redirect_response_for_external_authentication(
try {{
// if inside iframe, send post message to parent for redirection
if (window.self !== window.parent) {{
window.top.postMessage({{poll_status: poll_status_data}}, '*')
window.parent.postMessage({{poll_status: poll_status_data}}, '*')
// if parent, redirect self to return_url
}} else {{
window.location.href = return_url
}}
}}
catch(err) {{
// if error occurs, send post message to parent and wait for 10 secs to redirect. if doesn't redirect, redirect self to return_url
window.top.postMessage({{poll_status: poll_status_data}}, '*')
window.parent.postMessage({{poll_status: poll_status_data}}, '*')
setTimeout(function() {{
window.location.href = return_url
}}, 10000);
Expand All @@ -1270,15 +1270,15 @@ pub fn get_html_redirect_response_for_external_authentication(
try {{
// if inside iframe, send post message to parent for redirection
if (window.self !== window.parent) {{
window.top.postMessage({{openurl_if_required: return_url}}, '*')
window.parent.postMessage({{openurl_if_required: return_url}}, '*')
// if parent, redirect self to return_url
}} else {{
window.location.href = return_url
}}
}}
catch(err) {{
// if error occurs, send post message to parent and wait for 10 secs to redirect. if doesn't redirect, redirect self to return_url
window.top.postMessage({{openurl_if_required: return_url}}, '*')
window.parent.postMessage({{openurl_if_required: return_url}}, '*')
setTimeout(function() {{
window.location.href = return_url
}}, 10000);
Expand Down

0 comments on commit f9b489a

Please sign in to comment.