mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Merge pull request #264 from KiranNiranjan/ELECTRON-253
Electron-253 (Fixed an issue whit basic auth)
This commit is contained in:
commit
029358f6b1
@ -111,18 +111,12 @@ function openBasicAuthWindow(windowName, hostname, isValidCredentials, clearSett
|
|||||||
ipc.on('login', (event, args) => {
|
ipc.on('login', (event, args) => {
|
||||||
if (typeof args === 'object' && typeof local.authCallback === 'function') {
|
if (typeof args === 'object' && typeof local.authCallback === 'function') {
|
||||||
local.authCallback(args.username, args.password);
|
local.authCallback(args.username, args.password);
|
||||||
basicAuthWindow.close();
|
closeAuthWindow(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ipc.on('close-basic-auth', () => {
|
ipc.on('close-basic-auth', () => {
|
||||||
if (typeof local.clearSettings === 'function') {
|
closeAuthWindow(true);
|
||||||
local.clearSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (basicAuthWindow) {
|
|
||||||
basicAuthWindow.close();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,6 +126,19 @@ function destroyWindow() {
|
|||||||
basicAuthWindow = null;
|
basicAuthWindow = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to close the auth window
|
||||||
|
* @param {boolean} clearSettings - Whether to clear the auth settings
|
||||||
|
*/
|
||||||
|
function closeAuthWindow(clearSettings) {
|
||||||
|
if (clearSettings && typeof local.clearSettings === 'function') {
|
||||||
|
local.clearSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (basicAuthWindow) {
|
||||||
|
basicAuthWindow.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
openBasicAuthWindow: openBasicAuthWindow
|
openBasicAuthWindow: openBasicAuthWindow
|
||||||
|
Loading…
Reference in New Issue
Block a user