From e17a818deb6a8ffca16091858be400466698135d Mon Sep 17 00:00:00 2001 From: nmemmert Date: Wed, 3 Jun 2026 14:31:22 -0400 Subject: [PATCH] fix --- .../3307bdd7-a770-4fad-a28e-cf2d0c2a6e34.json | 5 ++--- server.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/data/study-progress/3307bdd7-a770-4fad-a28e-cf2d0c2a6e34.json b/data/study-progress/3307bdd7-a770-4fad-a28e-cf2d0c2a6e34.json index 2bf0669..6ee413f 100644 --- a/data/study-progress/3307bdd7-a770-4fad-a28e-cf2d0c2a6e34.json +++ b/data/study-progress/3307bdd7-a770-4fad-a28e-cf2d0c2a6e34.json @@ -2,8 +2,7 @@ "byStudy": { "colossians": { "completedSectionIds": [ - "1-1-2", - "1-3-8" + "1-1-2" ], "quizAnswers": { "1-1-2": [ @@ -13,5 +12,5 @@ } } }, - "updatedAt": "2026-06-03T17:48:33.375Z" + "updatedAt": "2026-06-03T18:15:19.898Z" } \ No newline at end of file diff --git a/server.js b/server.js index f4c452e..eb4a5db 100644 --- a/server.js +++ b/server.js @@ -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, }) }