mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 01:11:13 -06:00
SDA-4150: Non-Browser Login will be able to login normally (#1847)
This commit is contained in:
parent
8c0ae96edc
commit
aa03d1d5ff
@ -421,6 +421,8 @@ ipcMain.on(
|
||||
? userConfigURL
|
||||
: globalConfigURL;
|
||||
const { subdomain, domain, tld } = whitelistHandler.parseDomain(podUrl);
|
||||
const localConfig = config.getConfigFields(['enableBrowserLogin']);
|
||||
|
||||
formattedPodUrl = `https://${subdomain}.${domain}${tld}`;
|
||||
loginUrl = getBrowserLoginUrl(formattedPodUrl);
|
||||
logger.info(
|
||||
@ -428,7 +430,27 @@ ipcMain.on(
|
||||
'check if sso is enabled for the pod',
|
||||
formattedPodUrl,
|
||||
);
|
||||
loadPodUrl();
|
||||
|
||||
if (localConfig.enableBrowserLogin) {
|
||||
logger.info(
|
||||
'main-api-handler:',
|
||||
'check if sso is enabled for the pod',
|
||||
formattedPodUrl,
|
||||
);
|
||||
loadPodUrl(false);
|
||||
} else {
|
||||
logger.info(
|
||||
'main-api-handler:',
|
||||
'browser login is not enabled - loading main window with',
|
||||
formattedPodUrl,
|
||||
);
|
||||
const mainWebContents = windowHandler.getMainWebContents();
|
||||
if (mainWebContents && !mainWebContents.isDestroyed()) {
|
||||
windowHandler.setMainWindowOrigin(formattedPodUrl);
|
||||
mainWebContents.loadURL(formattedPodUrl);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case apiCmds.setBroadcastMessage:
|
||||
if (swiftSearchInstance) {
|
||||
@ -673,17 +695,6 @@ const loadPodUrl = (proxyLogin = false) => {
|
||||
loginUrl,
|
||||
);
|
||||
await shell.openExternal(loginUrl);
|
||||
} else {
|
||||
logger.info(
|
||||
'main-api-handler:',
|
||||
'browser login is not enabled - loading main window with',
|
||||
formattedPodUrl,
|
||||
);
|
||||
const mainWebContents = windowHandler.getMainWebContents();
|
||||
if (mainWebContents && !mainWebContents.isDestroyed()) {
|
||||
windowHandler.setMainWindowOrigin(formattedPodUrl);
|
||||
mainWebContents.loadURL(formattedPodUrl);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(async (error) => {
|
||||
|
Loading…
Reference in New Issue
Block a user