Used the typed method SettingStorage.getUserSettings()
MODIFY
src/server/rest/v1/service/AuthService.ts
src/server/rest/v1/service/AuthService.ts
@@ -539,8 +539,8 @@ export default class AuthService {
message: 'Wrong Verification Token'
});
}
- const userSetting = await SettingStorage.getSettingByIdentifier(tenantID, TechnicalSettings.USER);
- const userStatus = userSetting.content.user.autoActivateAccountAfterValidation ? UserStatus.ACTIVE : UserStatus.INACTIVE;
+ const userSetting = await SettingStorage.getUserSettings(tenantID);
+ const userStatus = userSetting.user.autoActivateAccountAfterValidation ? UserStatus.ACTIVE : UserStatus.INACTIVE;
// Save User Status
await UserStorage.saveUserStatus(tenantID, user.id, userStatus);
// For integration with billing

MODIFY
src/storage/mongodb/SettingStorage.ts
src/storage/mongodb/SettingStorage.ts
@@ -336,7 +336,7 @@ export default class SettingStorage {
}
public static async getUserSettings(tenantID: string): Promise<UserSetting> {
- let userSetting : UserSetting = null;
+ let userSetting : UserSetting;
// Get the user settings
const settings = await SettingStorage.getSettings(tenantID, { identifier: TechnicalSettings.USER }, Constants.DB_PARAMS_SINGLE_RECORD);
if (settings && settings.count > 0 && settings.result[0]) {

Used the typed method SettingStorage.getUserSettings()