From eeb3e59985ccafe2f7790efa19f45e7ec115acf2 Mon Sep 17 00:00:00 2001 From: Nattfarinn Date: Fri, 15 Sep 2023 09:45:10 +0200 Subject: [PATCH] IBX-5705: Fixed InteractiveLoginToken using PostAuthenticationGuardToken --- src/lib/MVC/Symfony/Security/InteractiveLoginToken.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/MVC/Symfony/Security/InteractiveLoginToken.php b/src/lib/MVC/Symfony/Security/InteractiveLoginToken.php index 2a5619e183..65167c3eda 100644 --- a/src/lib/MVC/Symfony/Security/InteractiveLoginToken.php +++ b/src/lib/MVC/Symfony/Security/InteractiveLoginToken.php @@ -7,6 +7,7 @@ namespace Ibexa\Core\MVC\Symfony\Security; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; +use Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken; /** * This token is used when a user has been matched by a foreign user provider. @@ -41,6 +42,15 @@ public function __unserialize($serialized): void [$this->originalTokenType, $parentStr] = $serialized; parent::__unserialize($parentStr); } + + public function isAuthenticated(): bool + { + if (PostAuthenticationGuardToken::class === $this->originalTokenType) { + return true; + } + + return parent::isAuthenticated(); + } } class_alias(InteractiveLoginToken::class, 'eZ\Publish\Core\MVC\Symfony\Security\InteractiveLoginToken');