Commit bbbff11
committed
fix(auth): prevent code requests for invalid dashboard users
Refactors the validation logic in `AuthService.initiateEmailSignIn` to
correct a critical security flaw.
Previously, the logic allowed verification codes to be sent to any email
address during a dashboard login attempt, even if the user did not exist
or lacked permissions.
This change restructures the validation into a more explicit `if-else if`
block. It now correctly throws an `UnauthorizedException` if the user is
not found or a `ForbiddenException` if they lack permissions, ensuring
that execution is halted immediately and a code is never sent for an
invalid dashboard login attempt.1 parent 9a2b1e9 commit bbbff11
1 file changed
+5
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 86 | + | |
90 | 87 | | |
91 | 88 | | |
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
95 | 92 | | |
96 | 93 | | |
| 94 | + | |
97 | 95 | | |
98 | 96 | | |
99 | 97 | | |
| |||
0 commit comments