Commit c790c9e
committed
Implement user account lockout and multi-method 2FA
- Added TwoFactorAuthService supporting TOTP (Google Authenticator) and email-based 2FA with backup codes
- Implemented 2FA setup, verification, disabling, and regeneration commands with corresponding handlers
- Created new API router and request/response schemas for 2FA endpoints
- Updated LoginUserCommandHandler to integrate 2FA verification and temporary token generation
- Enhanced account lockout mechanism to prevent brute force login attempts
- Added dependency injection for new 2FA handlers and integrated with existing auth flow1 parent 807e5c7 commit c790c9e
8 files changed
Lines changed: 995 additions & 57 deletions
File tree
- src
- core/security
- modules/user
- application/auth
- login_user
- two_factor
- presentation
- routers
- schemas
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 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 | 4 | | |
40 | | - | |
41 | | - | |
| 5 | + | |
| 6 | + | |
42 | 7 | | |
43 | 8 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
47 | 20 | | |
| 21 | + | |
48 | 22 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 23 | | |
0 commit comments