Commit ae46582
fix(2fa): remove non-functional backup recovery code UI
Enrollment generated 10 recovery codes with Math.random(), showed them in
a modal telling users to store them safely, and never persisted them. The
2FA challenge screen's backup-code branch was a placeholder that rejected
every code unconditionally, so no code could ever work. Users who enabled
2FA and lost their authenticator were left holding codes that did nothing.
Removes the backup-code path from the challenge form and replaces the
recovery-code modal with an honest confirmation that says recovery codes
are not available yet and losing the device means asking an admin to reset
2FA.
The TOTP flow is unchanged — the middleware assurance-level check and
challengeAndVerify were correct and are left alone. Real recovery codes
are specced separately in
docs/tasks/Jury-FS/2FA-Recovery-Codes-Are-Non-Functional.md.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent b661a02 commit ae46582
2 files changed
Lines changed: 20 additions & 53 deletions
File tree
- apps/codebility/app
- auth/2fa-challenge/_components
- home/account-settings/_components
Lines changed: 10 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 55 | | |
64 | 56 | | |
65 | 57 | | |
| |||
90 | 82 | | |
91 | 83 | | |
92 | 84 | | |
93 | | - | |
| 85 | + | |
94 | 86 | | |
95 | 87 | | |
96 | 88 | | |
97 | 89 | | |
98 | | - | |
| 90 | + | |
99 | 91 | | |
100 | | - | |
| 92 | + | |
101 | 93 | | |
102 | 94 | | |
103 | 95 | | |
| |||
106 | 98 | | |
107 | 99 | | |
108 | 100 | | |
109 | | - | |
| 101 | + | |
110 | 102 | | |
111 | 103 | | |
112 | 104 | | |
113 | 105 | | |
114 | 106 | | |
115 | 107 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
127 | 112 | | |
128 | 113 | | |
129 | 114 | | |
| |||
Lines changed: 10 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
115 | 112 | | |
116 | 113 | | |
117 | 114 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | 115 | | |
125 | 116 | | |
126 | 117 | | |
| |||
277 | 268 | | |
278 | 269 | | |
279 | 270 | | |
280 | | - | |
| 271 | + | |
281 | 272 | | |
282 | 273 | | |
283 | 274 | | |
284 | 275 | | |
285 | | - | |
| 276 | + | |
286 | 277 | | |
287 | 278 | | |
288 | | - | |
| 279 | + | |
289 | 280 | | |
290 | 281 | | |
291 | 282 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
300 | 289 | | |
301 | 290 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 291 | + | |
310 | 292 | | |
311 | 293 | | |
312 | 294 | | |
| |||
0 commit comments