refactor(auth): the current user service carries the profile
CurrentUser answers who is visiting and, on demand, loads their row: id(), isGuest(), isValid() and a lazy user() behind UserRepositoryInterface::find(). A guest is an empty model, and both the identity and the profile are dropped between requests.
The core reads the visitor through it: the legacy classes, the casts, the validators and the Twig app variable. The shared User instance stays for now, mirrored from the same answer once per request.
Two side effects move out of the way: the ip history becomes IpHistoryRecorder, called by the kernel, and TranslatorServiceFactory stops resolving the visitor locale — at boot there is no database connection yet, and the kernel applies their language anyway.
The core reads the visitor through it: the legacy classes, the casts, the validators and the Twig app variable. The shared User instance stays for now, mirrored from the same answer once per request.
Two side effects move out of the way: the ip history becomes IpHistoryRecorder, called by the kernel, and TranslatorServiceFactory stops resolving the visitor locale — at boot there is no database connection yet, and the kernel applies their language anyway.