diff --git a/Domain/SecurityIdentityRetrievalStrategy.php b/Domain/SecurityIdentityRetrievalStrategy.php index d1e9453..0a60331 100644 --- a/Domain/SecurityIdentityRetrievalStrategy.php +++ b/Domain/SecurityIdentityRetrievalStrategy.php @@ -17,6 +17,7 @@ use Symfony\Component\Security\Core\Authentication\Token\NullToken; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter; +use Symfony\Component\Security\Core\Authorization\Voter\CacheableVoterInterface; use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; /** @@ -78,7 +79,7 @@ public function getSecurityIdentities(TokenInterface $token) private function isNotAuthenticated(TokenInterface $token): bool { - if (\defined('\Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter::PUBLIC_ACCESS')) { + if (method_exists($this->authenticationTrustResolver, 'isAuthenticated')) { return !$this->authenticationTrustResolver->isAuthenticated($token); }