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(router): send post message to window.parent instead of window.top in external 3ds flow #5778

Merged
merged 1 commit into from
Sep 3, 2024
Merged
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
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
Loading