This commit is contained in:
nmemmert
2026-06-03 14:31:22 -04:00
parent 68f6212e9b
commit e17a818deb
2 changed files with 12 additions and 3 deletions
+10
View File
@@ -70,6 +70,7 @@ const BACKUP_DIR = path.join(DATA_DIR, 'backups')
const UPLOADS_DIR = path.join(DATA_DIR, 'uploads')
const UPLOADS_META_FILE = path.join(DATA_DIR, 'uploads-meta.json')
const DOWNLOAD_COUNTS_FILE = path.join(DATA_DIR, 'download-counts.json')
const STUDY_REMINDERS_FILE = path.join(DATA_DIR, 'study-reminders.json')
const DIST_DIR = path.join(__dirname, 'dist')
const INDEX_FILE = path.join(DIST_DIR, 'index.html')
const DIST_IMAGES_DIR = path.join(DIST_DIR, 'images')
@@ -2615,8 +2616,17 @@ function sanitizeStudyUsers(value) {
studyRemindersEnabled,
enrolledStudySlugs,
avatarUrl: typeof item?.avatarUrl === 'string' ? item.avatarUrl.trim() : '',
createdAt: typeof item?.createdAt === 'string' ? item.createdAt : null,
updatedAt: typeof item?.updatedAt === 'string' ? item.updatedAt : null,
lastLoginAt: typeof item?.lastLoginAt === 'string' ? item.lastLoginAt : null,
pendingEmailChange,
// 2FA fields
twoFaMethod: item?.twoFaMethod === 'app' || item?.twoFaMethod === 'email' ? item.twoFaMethod : null,
totpSecret: typeof item?.totpSecret === 'string' && item.totpSecret ? item.totpSecret : null,
totpVerified: item?.totpVerified === true,
totpEnabledAt: typeof item?.totpEnabledAt === 'string' ? item.totpEnabledAt : null,
totpRecoveryCodes: Array.isArray(item?.totpRecoveryCodes) ? item.totpRecoveryCodes.filter(h => typeof h === 'string') : [],
totpSecretPending: typeof item?.totpSecretPending === 'string' ? item.totpSecretPending : undefined,
})
}