Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
fix(2FA): increase backup codes length for improved security
Rudy B.a9a873c293c4
diff --git a/src/components/modals/TwoFactorSuccessModal.module.css b/src/components/modals/TwoFactorSuccessModal.module.cssindex 2804fe91c..aba87fdd5 100644--- a/src/components/modals/TwoFactorSuccessModal.module.css+++ b/src/components/modals/TwoFactorSuccessModal.module.css@@ -1,5 +1,5 @@.dialog {- width: 480px;+ width: 620px;max-width: 95vw;}diff --git a/src/lib/two-factor/backup-codes.ts b/src/lib/two-factor/backup-codes.tsindex a201cf24e..256131d26 100644--- a/src/lib/two-factor/backup-codes.ts+++ b/src/lib/two-factor/backup-codes.ts@@ -11,9 +11,9 @@ export async function generateBackupCodes(): Promise<{const plaintext = Array.from({ length: BACKUP_CODE_COUNT },() =>- randomBytes(5).toString('hex').toUpperCase() ++ randomBytes(8).toString('hex').toUpperCase() +'-' +- randomBytes(5).toString('hex').toUpperCase(),+ randomBytes(8).toString('hex').toUpperCase(),);const hashed = await Promise.all(plaintext.map(code => bcrypt.hash(code, BCRYPT_ROUNDS)));return { plaintext, hashed };