fix(2FA): increase backup codes length for improved security

This commit is contained in:
Rudy B. committed 2026-04-25 12:20:47 +02:00
1 parent 6c6765291f
commit a9a873c293
2 files changed
+3 -3

No files matched your search

@@ -1,5 +1,5 @@
.dialog {
width: 480px;
width: 620px;
max-width: 95vw;
}
+2 -2
View File
@@ -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 };