DeepSeek V4 Pro · Balanced
feat-2fa-backup-codes-cal-com
cal.com · TypeScript · M · 100–299 lines · 6 files
The normal review, with one generalist agent. Judge: Claude Opus 5.5.
- Gold bugs found
- 2 of 8
- Comments published
- 2
- Comments matching a bug
- 2
- Comments not matching
- 0
- Cost of this PR
- $0.453
Published comments (2)
Backup code consumption is non-atomic and can allow code reuse — Two concurrent requests using the same backup code can both pass the indexOf check before either update commits, and concurrent requests with different codes can overwrite each other and resurrect a consumed code. Make the consume atomic with a single conditional UPDATE or a transaction.
Successful /enable response does not call onEnable — If the user closes the backup-codes screen via Escape or the overlay, onEnable never runs, so the switch shows 2FA as disabled and reopening shows the stale DisplayBackupCodes step. Invoke onEnable() as soon as /enable returns 200.