Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-5705: Fixed InteractiveLoginToken using PostAuthenticationGuardToken #274

Merged
merged 9 commits into from
Sep 19, 2023
10 changes: 10 additions & 0 deletions src/lib/MVC/Symfony/Security/InteractiveLoginToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
}
alongosz marked this conversation as resolved.
Show resolved Hide resolved
}

class_alias(InteractiveLoginToken::class, 'eZ\Publish\Core\MVC\Symfony\Security\InteractiveLoginToken');