Neos\Flow\Security\Aspect\LoggingAspect::logManagerLogout PHP Method

logManagerLogout() public method

Logs calls and results of the logout() method of the Authentication Manager
public logManagerLogout ( Neos\Flow\Aop\JoinPointInterface $joinPoint ) : mixed
$joinPoint Neos\Flow\Aop\JoinPointInterface The current joinpoint
return mixed The result of the target method if it has not been intercepted
    public function logManagerLogout(JoinPointInterface $joinPoint)
    {
        /** @var AuthenticationManagerInterface $authenticationManager */
        $authenticationManager = $joinPoint->getProxy();
        $securityContext = $authenticationManager->getSecurityContext();
        if (!$securityContext->isInitialized()) {
            return;
        }
        $accountIdentifiers = [];
        foreach ($securityContext->getAuthenticationTokens() as $token) {
            /** @var $account Account */
            $account = $token->getAccount();
            if ($account !== null) {
                $accountIdentifiers[] = $account->getAccountIdentifier();
            }
        }
        $this->securityLogger->log(sprintf('Logged out %d account(s). (%s)', count($accountIdentifiers), implode(', ', $accountIdentifiers)), LOG_INFO);
    }