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);
}