Frontend user
The frontend.
frontend request attribute provides the
\TYPO3\
object.
The topic is described in depth in chapter Authentication.
Example:
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
public function doSomethingToFrontendUser(ServerRequestInterface $request): void
{
/** @var FrontendUserAuthentication $frontendUserAuthentification */
$frontendUserAuthentification = $request->getAttribute('frontend.user');
$frontendUserAuthentification->fetchGroupData($request);
// do something
}
Copied!
Tip
The frontend user id and groups are available from the User aspect.