mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -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
|
? userConfigURL
|
||||||
: globalConfigURL;
|
: globalConfigURL;
|
||||||
const { subdomain, domain, tld } = whitelistHandler.parseDomain(podUrl);
|
const { subdomain, domain, tld } = whitelistHandler.parseDomain(podUrl);
|
||||||
|
const localConfig = config.getConfigFields(['enableBrowserLogin']);
|
||||||
|
|
||||||
formattedPodUrl = `https://${subdomain}.${domain}${tld}`;
|
formattedPodUrl = `https://${subdomain}.${domain}${tld}`;
|
||||||
loginUrl = getBrowserLoginUrl(formattedPodUrl);
|
loginUrl = getBrowserLoginUrl(formattedPodUrl);
|
||||||
logger.info(
|
logger.info(
|
||||||
@ -428,7 +430,27 @@ ipcMain.on(
|
|||||||
'check if sso is enabled for the pod',
|
'check if sso is enabled for the pod',
|
||||||
formattedPodUrl,
|
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;
|
break;
|
||||||
case apiCmds.setBroadcastMessage:
|
case apiCmds.setBroadcastMessage:
|
||||||
if (swiftSearchInstance) {
|
if (swiftSearchInstance) {
|
||||||
@ -673,17 +695,6 @@ const loadPodUrl = (proxyLogin = false) => {
|
|||||||
loginUrl,
|
loginUrl,
|
||||||
);
|
);
|
||||||
await shell.openExternal(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) => {
|
.catch(async (error) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user