diff --git a/backend/controllers/shared/RTLConf.js b/backend/controllers/shared/RTLConf.js index 79dbb652..35270a0a 100644 --- a/backend/controllers/shared/RTLConf.js +++ b/backend/controllers/shared/RTLConf.js @@ -254,7 +254,7 @@ export const updateApplicationSettings = (req, res, next) => { try { const oldConfig = JSON.parse(fs.readFileSync(RTLConfFile, 'utf-8')); const config = common.addSecureData(JSON.parse(JSON.stringify(req.body))); - const runtimeConfig = JSON.parse(JSON.stringify(oldConfig)); + const runtimeConfig = oldConfig; Object.keys(config).forEach((key) => { if (key !== 'nodes') { runtimeConfig[key] = config[key]; @@ -298,6 +298,7 @@ export const updateApplicationSettings = (req, res, next) => { delete fileConfig.allowPasswordUpdate; delete fileConfig.rtlConfFilePath; delete fileConfig.rtlPass; + delete fileConfig.multiPass; fileConfig.nodes?.forEach((node) => { delete node.authentication?.options; delete node.authentication?.runeValue; diff --git a/backend/utils/common.js b/backend/utils/common.js index 0c6b37ef..9de430f9 100644 --- a/backend/utils/common.js +++ b/backend/utils/common.js @@ -73,6 +73,7 @@ export class CommonService { config.nodes?.forEach((node) => { const appConfigNode = appConfigNodes.get(node.index); if (appConfigNode?.authentication) { + node.authentication = node.authentication || {}; if (appConfigNode.authentication.macaroonPath) { node.authentication.macaroonPath = appConfigNode.authentication.macaroonPath; } diff --git a/server/controllers/shared/RTLConf.ts b/server/controllers/shared/RTLConf.ts index dae540d3..bc86d75c 100644 --- a/server/controllers/shared/RTLConf.ts +++ b/server/controllers/shared/RTLConf.ts @@ -254,7 +254,7 @@ export const updateApplicationSettings = (req, res, next) => { try { const oldConfig = JSON.parse(fs.readFileSync(RTLConfFile, 'utf-8')); const config = common.addSecureData(JSON.parse(JSON.stringify(req.body))); - const runtimeConfig = JSON.parse(JSON.stringify(oldConfig)); + const runtimeConfig = oldConfig; Object.keys(config).forEach((key) => { if (key !== 'nodes') { runtimeConfig[key] = config[key]; @@ -298,6 +298,7 @@ export const updateApplicationSettings = (req, res, next) => { delete fileConfig.allowPasswordUpdate; delete fileConfig.rtlConfFilePath; delete fileConfig.rtlPass; + delete fileConfig.multiPass; fileConfig.nodes?.forEach((node) => { delete node.authentication?.options; delete node.authentication?.runeValue; diff --git a/server/utils/common.ts b/server/utils/common.ts index 685f6656..79a23584 100644 --- a/server/utils/common.ts +++ b/server/utils/common.ts @@ -82,6 +82,7 @@ export class CommonService { config.nodes?.forEach((node) => { const appConfigNode = appConfigNodes.get(node.index); if (appConfigNode?.authentication) { + node.authentication = node.authentication || {}; if (appConfigNode.authentication.macaroonPath) { node.authentication.macaroonPath = appConfigNode.authentication.macaroonPath; }