Split the \League\OAuth2\Server\Entities\Traits\AccessTokenTrait::convertToJWT() function into two separate functions so that implementing classes can customize the token. E.g.
class AccessToken implements AccessTokenEntityInterface
{
// ...
use AccessTokenTrait {
getJwtBuilder as traitGetJwtBuilder;
}
// ...
private function getJwtBuilder()
{
$builder = $this->traitGetJwtBuilder();
$builder->withClaim('my_custom_claim', 'custom claim value');
return $builder;
}
Split the
\League\OAuth2\Server\Entities\Traits\AccessTokenTrait::convertToJWT()
function into two separate functions so that implementing classes can customize the token. E.g.