Commit graph

9 commits

Author SHA1 Message Date
722c5303df
refactor: remove unused response param from controller methods 2026-05-17 10:04:15 +03:00
9661452c75
refactor: extract error response helper and slim json response
Replace multiple catch blocks with single catch(Throwable) funneled through errorResponse() matching the CompanyController pattern. Also clean jsonResponse to accept data+status only, instantiating Response internally.
2026-05-17 09:59:32 +03:00
56ddba707d
format: fix psr12 style issues
phpcbf auto-fixes: string concatenation spacing, single-line class braces, closing brace placement.
2026-05-17 09:45:26 +03:00
9703f82788
add domain layer, config, and entry point
Domain: User, Session, EmailAddress, DTOs, repositories, services (PasswordHasher, TokenGenerator, Clock). Config: PHP-DI container definitions and Slim routes. Entry point: public/index.php with slim-bridge.
2026-05-17 09:45:26 +03:00
e54197f8a5
implement auth controller
Green phase: AuthController handles login (authenticate + create session + set cookie), logout (delete session + clear cookie), and me (return user from request attribute).
2026-05-17 09:45:25 +03:00
b581e80413
implement auth middleware
Green phase: PSR-15 AuthMiddleware checks auth_token cookie, looks up session, validates expiry, sets user attribute on request or returns 401.
2026-05-17 09:45:25 +03:00
58772d66c1
implement logout use case
Green phase: Logout calls deleteByToken on SessionRepository. No-op for non-existent tokens.
2026-05-17 09:45:24 +03:00
d490260807
implement create session use case
Green phase: CreateSession generates a token, creates a session with 7-day expiry, and persists it via SessionRepository.
2026-05-17 09:45:23 +03:00
b14cd565bb
implement authenticate user use case
Green phase: AuthenticateUser validates credentials, throws BadRequestException for empty fields, UnauthorizedException for unknown email or wrong password.
2026-05-17 09:45:23 +03:00