diff --git a/server/db/mongo/modules/settingsModule.js b/server/db/mongo/modules/settingsModule.js index 2c1b402c3..d3568ad32 100755 --- a/server/db/mongo/modules/settingsModule.js +++ b/server/db/mongo/modules/settingsModule.js @@ -21,6 +21,11 @@ const updateAppSettings = async (newSettings) => { delete update.$set.pagespeedApiKey; } + if (newSettings.systemEmailPassword === "") { + update.$unset = { systemEmailPassword: "" }; + delete update.$set.systemEmailPassword; + } + const settings = await AppSettings.findOneAndUpdate({}, update, { new: true, upsert: true,