Commit 1a2f41f
[Login] Backup Codes (#10434)
## Summary of the problem
<!-- Why these changes are being made? What problem does it solve? Link
any related issues to provide more details. -->
People might get locked out of their accounts with no way to get back
in, which is bad.
## Describe your changes
<!-- Explain your thought process to the solution and provide a quick
summary of the changes. -->
Added backup codes, securely generated, SHA-512 BLT seasoned with fresh
S&P.
<!-- If there are any visual changes, please attach images, videos, or
gifs. -->
<img width="969" alt="Screenshot 2025-05-24 at 11 11 25 PM"
src="https://github.com/user-attachments/assets/bf632d3c-3999-46c0-af88-30643fb4f3b2"
/>
<img width="969" alt="Screenshot 2025-05-24 at 11 11 48 PM"
src="https://github.com/user-attachments/assets/c807d0b5-04ad-4133-b653-c396087b778d"
/>
<img width="969" alt="Screenshot 2025-05-24 at 11 07 44 PM"
src="https://github.com/user-attachments/assets/5194a9ab-18af-4c51-84c5-78e71616f3fa"
/>
<img width="460" alt="Screenshot 2025-05-24 at 11 12 30 PM"
src="https://github.com/user-attachments/assets/cf2f04c2-a36a-425a-9466-8215ad1260c8"
/>
<img width="460" alt="Screenshot 2025-05-24 at 11 12 55 PM"
src="https://github.com/user-attachments/assets/613c4f8c-73cf-4671-b369-7d87291dd723"
/>
<img width="969" alt="Screenshot 2025-05-24 at 11 10 55 PM"
src="https://github.com/user-attachments/assets/ab2112a0-237a-4371-8087-fcadf0ae8bb9"
/>
<img width="565" alt="Screenshot 2025-05-24 at 11 24 17 PM"
src="https://github.com/user-attachments/assets/bcf4e726-9e66-480d-8d50-c2d60d3de981"
/>
<img width="565" alt="Screenshot 2025-05-24 at 11 27 51 PM"
src="https://github.com/user-attachments/assets/378a523d-d127-4227-a28a-8473573c2d29"
/>
<img width="565" alt="Screenshot 2025-05-24 at 11 29 08 PM"
src="https://github.com/user-attachments/assets/0aaff1cb-d87d-439c-8ac5-fdc64bb53634"
/>
<img width="565" alt="Screenshot 2025-05-24 at 11 23 22 PM"
src="https://github.com/user-attachments/assets/1d4eca81-7326-47b4-945c-42f9dbbf83f0"
/>
<img width="565" alt="Screenshot 2025-05-24 at 11 23 48 PM"
src="https://github.com/user-attachments/assets/d96d7e8f-3aec-4c18-bd20-7496f3e1b7ae"
/>
<img width="565" alt="Screenshot 2025-05-24 at 11 25 59 PM"
src="https://github.com/user-attachments/assets/333a7e99-7f39-4342-be18-c4037d738a7c"
/>
---------
Co-authored-by: Gary Tou <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Cornu <[email protected]>1 parent cbf8bb2 commit 1a2f41f
File tree
22 files changed
+459
-4
lines changed- app
- controllers
- mailers/user
- models
- user
- policies
- views
- logins
- users
- user/backup_code_mailer
- config
- db
- migrate
- spec
- controllers
- mailers/previews/user
22 files changed
+459
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
231 | 233 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| |||
884 | 885 | | |
885 | 886 | | |
886 | 887 | | |
| 888 | + | |
887 | 889 | | |
888 | 890 | | |
889 | 891 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
145 | 151 | | |
146 | 152 | | |
147 | 153 | | |
| |||
155 | 161 | | |
156 | 162 | | |
157 | 163 | | |
| 164 | + | |
| 165 | + | |
158 | 166 | | |
159 | 167 | | |
160 | 168 | | |
| |||
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
| 225 | + | |
217 | 226 | | |
218 | 227 | | |
219 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
192 | 212 | | |
193 | 213 | | |
194 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
384 | 439 | | |
385 | 440 | | |
386 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments