Fix crash in getConfig

This commit is contained in:
Girish Ramakrishnan
2023-08-03 09:03:47 +05:30
parent d12e6ee2b3
commit 3caf0c3902

View File

@@ -144,8 +144,7 @@ async function getConfig() {
const release = safe.fs.readFileSync('/etc/lsb-release', 'utf-8');
if (release === null) throw new BoxError(BoxError.FS_ERROR, safe.error.message);
const ubuntuVersion = release.match(/DISTRIB_DESCRIPTION="(.*)"/)[1];
const allSettings = await settings.list();
const profileConfig = await users.getProfileConfig();
// be picky about what we send out here since this is sent for 'normal' users as well
return {
@@ -161,8 +160,8 @@ async function getConfig() {
cloudronName: await branding.getCloudronName(),
footer: await branding.renderFooter(),
features: appstore.getFeatures(),
profileLocked: allSettings[settings.PROFILE_CONFIG_KEY].lockUserProfiles,
mandatory2FA: allSettings[settings.PROFILE_CONFIG_KEY].mandatory2FA,
profileLocked: profileConfig.lockUserProfiles,
mandatory2FA: profileConfig.mandatory2FA,
};
}