Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Commit 6136298

Browse files
wouterjscheb
authored andcommitted
Add support for PUBLIC_ACCESS
(cherry picked from commit 1316a775b4bb2e088a538c755dc22e728489945f)
1 parent 3521fd3 commit 6136298

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Security/Authorization/TwoFactorAccessDecider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
99
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
1010
use Symfony\Component\Security\Http\AccessMapInterface;
11+
use Symfony\Component\Security\Http\Firewall\AccessListener;
1112
use Symfony\Component\Security\Http\HttpUtils;
1213
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
1314

@@ -49,6 +50,10 @@ public function isAccessible(Request $request, TokenInterface $token): bool
4950
{
5051
// Let routes pass, e.g. if a route needs to be callable during two-factor authentication
5152
list($attributes) = $this->accessMap->getPatterns($request);
53+
if (\defined(AccessListener::class.'::PUBLIC_ACCESS') && [AccessListener::PUBLIC_ACCESS] === $attributes) {
54+
return true;
55+
}
56+
5257
if (null !== $attributes && $this->accessDecisionManager->decide($token, $attributes, $request)) {
5358
return true;
5459
}

0 commit comments

Comments
 (0)