From 7fd219d51702886d27afaa196156d1b7350d5b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 3 Nov 2025 13:12:38 +0100 Subject: [PATCH] Refactor `JWTOnDavUrlAuthenticator` to extend `JWTAuthenticator` and update dependencies - Replaced `JWTTokenAuthenticator` with `JWTAuthenticator` for compatibility with updated security components. - Updated constructor to use `UserProviderInterface` instead of `TokenStorageInterface`. - Enhanced `getTokenExtractor` with correct return type declaration. --- .../Security/Guard/JWTOnDavUrlAuthenticator.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php index fe8ba2b73..1a1cc7672 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php @@ -11,30 +11,30 @@ declare(strict_types=1); namespace Chill\DocStoreBundle\Security\Guard; -use Lexik\Bundle\JWTAuthenticationBundle\Security\Guard\JWTTokenAuthenticator; +use Lexik\Bundle\JWTAuthenticationBundle\Security\Authenticator\JWTAuthenticator; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use Lexik\Bundle\JWTAuthenticationBundle\TokenExtractor\TokenExtractorInterface; -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; +use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Symfony\Contracts\Translation\TranslatorInterface; /** * Alter the base JWTTokenAuthenticator to add the special extractor for dav url endpoints. */ -class JWTOnDavUrlAuthenticator extends JWTTokenAuthenticator +class JWTOnDavUrlAuthenticator extends JWTAuthenticator { public function __construct( JWTTokenManagerInterface $jwtManager, EventDispatcherInterface $dispatcher, TokenExtractorInterface $tokenExtractor, private readonly DavOnUrlTokenExtractor $davOnUrlTokenExtractor, - TokenStorageInterface $preAuthenticationTokenStorage, + UserProviderInterface $userProvider, ?TranslatorInterface $translator = null, ) { - parent::__construct($jwtManager, $dispatcher, $tokenExtractor, $preAuthenticationTokenStorage, $translator); + parent::__construct($jwtManager, $dispatcher, $tokenExtractor, $userProvider, $translator); } - protected function getTokenExtractor() + protected function getTokenExtractor(): TokenExtractorInterface { return $this->davOnUrlTokenExtractor; }