implement AuthenticateUser use case
input validation: email + password required. constructs EmailAddress vo (BadRequest on bad format). looks up user; absent or password-mismatch -> UnauthorizedException with constant 'invalid credentials' message (no enumeration leak). password verified through PasswordHasher->verify against stored hash on the User entity (no separate profile lookup -> tide keeps password on the user row). returns the User entity for the caller (typically CreateSession + AuthController). 27 tests pass.
This commit is contained in:
parent
2731e610e5
commit
5b74e9d76a
2 changed files with 65 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace App\Auth\UseCases\AuthenticateUser;
|
||||
|
||||
class AuthenticateUserRequest
|
||||
{
|
||||
public function __construct(
|
||||
public ?string $email,
|
||||
public ?string $password,
|
||||
) {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue