8000 [Security] Fix AuthenticationTrustResolver::isAnonymous() · symfony/symfony@83da786 · GitHub
[go: up one dir, main page]

Skip to content

Commit 83da786

Browse files
chalasrnicolas-grekas
authored andcommitted
[Security] Fix AuthenticationTrustResolver::isAnonymous()
1 parent f638ea5 commit 83da786

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Security/Core/Authentication/AuthenticationTrustResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function isAnonymous(TokenInterface $token = null/*, $deprecation = true*
3838
trigger_deprecation('symfony/security-core', '5.4', 'The "%s()" method is deprecated, use "isAuthenticated()" or "isFullFledged()" if you want to check if the request is (fully) authenticated.', __METHOD__);
3939
}
4040

41-
return $token && !$this->isAuthenticated($token);
41+
return $token instanceof AnonymousToken || ($token && !$token->getUser());
4242
}
4343

4444
/**

0 commit comments

Comments
 (0)
0