Commit Graph

2 Commits

Author SHA1 Message Date
Luca Sacchi Ricciardi
3253293dd4 feat(auth): add get_current_user_from_api_token dependency
- Validates API tokens (or_api_* prefix)
- SHA-256 hash lookup in api_tokens table
- Updates last_used_at on each request
- Distinguishes from JWT tokens (401 with clear error)
2026-04-07 16:15:34 +02:00
Luca Sacchi Ricciardi
714bde681c feat(auth): T18 implement user registration endpoint
Add POST /api/auth/register endpoint with:
- UserRegister schema validation
- Email uniqueness check
- Password hashing with bcrypt
- User creation in database
- UserResponse returned (excludes password)

Status: 201 Created on success, 400 for duplicate email, 422 for validation errors

Test coverage: 5 tests for register endpoint
2026-04-07 13:57:38 +02:00