Skip to content

Commit

Permalink
IBX-5705: Fixed InteractiveLoginToken using PostAuthenticationGuardToken
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Sep 15, 2023
1 parent dbaf4fd commit eeb3e59
Showing 1 changed file with 10 additions and 0 deletions.
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();
}
}

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

0 comments on commit eeb3e59

Please sign in to comment.