From 93a7db2a7bf942a95219b565e6fb47e95a1b3eea Mon Sep 17 00:00:00 2001 From: Peter van der Wal Date: Thu, 11 Apr 2024 11:05:49 +0200 Subject: [PATCH] Bump lcobucci/jwt to version 5 (#11) --- composer.json | 2 +- src/Targeting/Storage/Cookie/JWTCookieSaveHandler.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index e4063e6..90996ed 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "geoip2/geoip2": "^2.9", "symfony/stopwatch": "^6.2", "symfony/form": "^6.2", - "lcobucci/jwt": "^4.0", + "lcobucci/jwt": "^4.0 || ^5.0", "matomo/device-detector": "^6.0", "pimcore/newsletter-bundle": "^1.0", "colinmollenhour/credis": "^1.10.0", diff --git a/src/Targeting/Storage/Cookie/JWTCookieSaveHandler.php b/src/Targeting/Storage/Cookie/JWTCookieSaveHandler.php index 82546b0..8d328d8 100644 --- a/src/Targeting/Storage/Cookie/JWTCookieSaveHandler.php +++ b/src/Targeting/Storage/Cookie/JWTCookieSaveHandler.php @@ -118,19 +118,18 @@ protected function createTokenBuilder(string $scope, string $name, \DateTimeInte { $time = new \DateTimeImmutable(); - $builder = $this->config->builder(); - $builder + $builder = $this->config->builder() ->issuedAt($time) ->withClaim(self::CLAIM_TARGETING_DATA, $data); if (0 === $expire) { - $builder->expiresAt($time->modify('+30 minutes')); // expire in 30 min + $builder = $builder->expiresAt($time->modify('+30 minutes')); // expire in 30 min } elseif (is_int($expire) && $expire > 0) { $expire = new \DateTimeImmutable('@'. $expire); - $builder->expiresAt($expire); + $builder = $builder->expiresAt($expire); } elseif ($expire instanceof \DateTimeInterface) { $expire = new \DateTimeImmutable('@'. $expire->getTimestamp()); - $builder->expiresAt($expire); + $builder = $builder->expiresAt($expire); } return $builder;