Skip to content

Commit

Permalink
Fix loginpopup behavior (#384)
Browse files Browse the repository at this point in the history
Fix issue with popup opening in new tab and not new window
  • Loading branch information
griffisc306 authored Mar 19, 2021
1 parent b554018 commit 0661df6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
"sinon": "^9.0.0",
"typescript": "3.0.1"
}
}
}
9 changes: 5 additions & 4 deletions release/connect-streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -26106,7 +26106,7 @@
if (params.loginUrl) {
connect.core.getPopupManager().clear(connect.MasterTopics.LOGIN_POPUP);
}
connect.core.loginWindow = connect.core.getPopupManager().open(loginUrl, connect.MasterTopics.LOGIN_POPUP);
connect.core.loginWindow = connect.core.getPopupManager().open(loginUrl, connect.MasterTopics.LOGIN_POPUP, params.loginOptions);

} catch (e) {
connect.getLog().error("ACK_TIMEOUT occurred but we are unable to open the login popup.").withException(e).sendInternalLogToServer();
Expand All @@ -26124,9 +26124,10 @@
global.clearInterval(connect.core.iframeRefreshInterval);
connect.core.iframeRefreshInterval = null;
connect.core.getPopupManager().clear(connect.MasterTopics.LOGIN_POPUP);
if (params.loginPopupAutoClose && connect.core.loginWindow) {
connect.core.loginWindow.close();
connect.core.loginWindow = null;
if ((params.loginPopupAutoClose || (params.loginOptions && params.loginOptions.autoClose)) &&
connect.core.loginWindow) {
connect.core.loginWindow.close();
connect.core.loginWindow = null;
}
});
}
Expand Down
7 changes: 4 additions & 3 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,8 @@
if (params.loginUrl) {
connect.core.getPopupManager().clear(connect.MasterTopics.LOGIN_POPUP);
}
connect.core.loginWindow = connect.core.getPopupManager().open(loginUrl, connect.MasterTopics.LOGIN_POPUP);
connect.core.loginWindow = connect.core.getPopupManager().open(loginUrl, connect.MasterTopics.LOGIN_POPUP, params.loginOptions);

} catch (e) {
connect.getLog().error("ACK_TIMEOUT occurred but we are unable to open the login popup.").withException(e).sendInternalLogToServer();
}
Expand All @@ -805,7 +805,8 @@
global.clearInterval(connect.core.iframeRefreshInterval);
connect.core.iframeRefreshInterval = null;
connect.core.getPopupManager().clear(connect.MasterTopics.LOGIN_POPUP);
if (params.loginPopupAutoClose && connect.core.loginWindow) {
if ((params.loginPopupAutoClose || (params.loginOptions && params.loginOptions.autoClose)) &&
connect.core.loginWindow) {
connect.core.loginWindow.close();
connect.core.loginWindow = null;
}
Expand Down

0 comments on commit 0661df6

Please sign in to comment.