Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split the AccessTokenTrait::convertToJWT() function so that the token can be customized #1382

Conversation

rhertogh
Copy link
Contributor

@rhertogh rhertogh commented Nov 2, 2023

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;
    }

…nvertToJWT()` function into two separate functions so that implementations can customize the token
…ction was added to the `AccessTokenTrait` to allow customization of the access token)
@rhertogh rhertogh changed the title Split the AccessTokenTrait::convertToJWT() function so the token can be customized Split the AccessTokenTrait::convertToJWT() function so that the token can be customized Nov 2, 2023
@rhertogh rhertogh marked this pull request as ready for review November 2, 2023 16:12
@parallels999
Copy link

#1328

@rhertogh
Copy link
Contributor Author

rhertogh commented Nov 6, 2023

Closed in favor of #1328

@rhertogh rhertogh closed this Nov 6, 2023
@parallels999
Copy link

Also, leave your comment on that PR, so the authors review it at least

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants