diff --git a/src/Entities/Traits/AccessTokenTrait.php b/src/Entities/Traits/AccessTokenTrait.php index f8f7109c3..febd59bf0 100644 --- a/src/Entities/Traits/AccessTokenTrait.php +++ b/src/Entities/Traits/AccessTokenTrait.php @@ -70,16 +70,14 @@ private function convertToJWT(): Token { $this->initJwtConfiguration(); - $builder = $this->jwtConfiguration->builder() + return $this->withBuilder($this->jwtConfiguration->builder() ->permittedFor($this->getClient()->getIdentifier()) ->identifiedBy($this->getIdentifier()) ->issuedAt(new DateTimeImmutable()) ->canOnlyBeUsedAfter(new DateTimeImmutable()) ->expiresAt($this->getExpiryDateTime()) ->relatedTo($this->getSubjectIdentifier()) - ->withClaim('scopes', $this->getScopes()); - - return $this->withBuilder($builder) + ->withClaim('scopes', $this->getScopes())) ->getToken($this->jwtConfiguration->signer(), $this->jwtConfiguration->signingKey()); }