You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(auth): make code request context-aware for dashboard login
Implements context-aware logic in the `AuthService.initiateEmailSignIn`
method.
- The method now accepts an `isDashboardLogin` boolean flag.
- If `isDashboardLogin` is true, the service first validates that a
user with the provided email exists and has either the 'admin' or
'publisher' role.
- An `UnauthorizedException` is thrown if the user does not exist.
- A `ForbiddenException` is thrown if the user exists but lacks the
required roles.
- A verification code is only sent if these checks pass.
- If `isDashboardLogin` is false, the original behavior of sending a
code without pre-validation is maintained for the user-facing app's
sign-in/sign-up flow.
This change enforces security at the first step of the dashboard login
process, preventing code generation for unauthorized users.
0 commit comments