mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
fix(router): send post message to window.parent instead of window.top in external 3ds flow (#5778)
This commit is contained in:
committed by
GitHub
parent
e3a9fb16c5
commit
f9b489ad0e
@ -1240,7 +1240,7 @@ pub fn get_html_redirect_response_for_external_authentication(
|
|||||||
try {{
|
try {{
|
||||||
// if inside iframe, send post message to parent for redirection
|
// if inside iframe, send post message to parent for redirection
|
||||||
if (window.self !== window.parent) {{
|
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
|
// if parent, redirect self to return_url
|
||||||
}} else {{
|
}} else {{
|
||||||
window.location.href = return_url
|
window.location.href = return_url
|
||||||
@ -1248,7 +1248,7 @@ pub fn get_html_redirect_response_for_external_authentication(
|
|||||||
}}
|
}}
|
||||||
catch(err) {{
|
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
|
// 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() {{
|
setTimeout(function() {{
|
||||||
window.location.href = return_url
|
window.location.href = return_url
|
||||||
}}, 10000);
|
}}, 10000);
|
||||||
@ -1270,7 +1270,7 @@ pub fn get_html_redirect_response_for_external_authentication(
|
|||||||
try {{
|
try {{
|
||||||
// if inside iframe, send post message to parent for redirection
|
// if inside iframe, send post message to parent for redirection
|
||||||
if (window.self !== window.parent) {{
|
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
|
// if parent, redirect self to return_url
|
||||||
}} else {{
|
}} else {{
|
||||||
window.location.href = return_url
|
window.location.href = return_url
|
||||||
@ -1278,7 +1278,7 @@ pub fn get_html_redirect_response_for_external_authentication(
|
|||||||
}}
|
}}
|
||||||
catch(err) {{
|
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
|
// 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() {{
|
setTimeout(function() {{
|
||||||
window.location.href = return_url
|
window.location.href = return_url
|
||||||
}}, 10000);
|
}}, 10000);
|
||||||
|
|||||||
Reference in New Issue
Block a user