From ba05058ec294fa02ab1d13d71908a35d374066ab Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Thu, 21 Jul 2022 13:45:45 +0200 Subject: [PATCH] UI: Fix Export Config to use the new configuration --- .../configuration-components/ExportConfigModal.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ExportConfigModal.tsx b/monkey/monkey_island/cc/ui/src/components/configuration-components/ExportConfigModal.tsx index ef11dd67f..159013e85 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ExportConfigModal.tsx +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ExportConfigModal.tsx @@ -10,6 +10,7 @@ import {reformatConfig} from './ReformatHook'; type Props = { show: boolean, configuration: object, + credentials: object, onHide: () => void } @@ -23,13 +24,16 @@ const ConfigExportModal = (props: Props) => { function onSubmit() { let config = reformatConfig(props.configuration, true); - let config_export = {'metadata': {}, 'contents': null}; + let credentials = props.credentials; + let config_export = {'metadata': {}, 'configuration': null, 'credentials': null}; if (radioValue === 'password') { - config_export.contents = encryptText(JSON.stringify(config), pass); + config_export.configuration = encryptText(JSON.stringify(config), pass); + config_export.credentials = encryptText(JSON.stringify(credentials), pass); config_export.metadata = {'encrypted': true}; } else { - config_export.contents = config; + config_export.configuration = config; + config_export.credentials = credentials; config_export.metadata = {'encrypted': false}; }