The login() function used 'request: LoginRequest' which shadowed FastAPI's Starlette Request object. Request.client was accessed on the LoginRequest Pydantic model instead of the HTTP request, causing AttributeError: 'LoginRequest' object has no attribute 'client'. Fix: rename the Pydantic parameter to 'body' and add explicit 'request: Request' for IP extraction and rate limiting.