From 58908c6eedcd0b6c406272f56602e694387e5dff Mon Sep 17 00:00:00 2001 From: Hafez Divandari Date: Fri, 7 Feb 2025 03:56:40 +0330 Subject: [PATCH] revert fix deprecation --- .../BearerTokenValidator.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/AuthorizationValidators/BearerTokenValidator.php b/src/AuthorizationValidators/BearerTokenValidator.php index 98ff615e3..0442dd48e 100644 --- a/src/AuthorizationValidators/BearerTokenValidator.php +++ b/src/AuthorizationValidators/BearerTokenValidator.php @@ -74,20 +74,13 @@ private function initJwtConfiguration(): void throw new RuntimeException('Public key is empty'); } - $validationConstraints = [ + $this->jwtConfiguration->setValidationConstraints( new LooseValidAt($clock, $this->jwtValidAtDateLeeway), new SignedWith( new Sha256(), InMemory::plainText($publicKeyContents, $this->publicKey->getPassPhrase() ?? '') - ), - ]; - - // TODO: next major release: bump lcobucci/jwt to ^5.5 and remove the following check - if (method_exists($this->jwtConfiguration, 'withValidationConstraints') === true) { - $this->jwtConfiguration = $this->jwtConfiguration->withValidationConstraints(...$validationConstraints); - } else { - $this->jwtConfiguration->setValidationConstraints(...$validationConstraints); - } + ) + ); } /**