Skip to content

Commit

Permalink
Add method exists for addClaim on token
Browse files Browse the repository at this point in the history
  • Loading branch information
Sephster committed Oct 1, 2020
1 parent 1d79e35 commit 6710412
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Grant/AbstractGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,10 @@ protected function issueAccessToken(
$accessToken->setExpiryDateTime((new DateTimeImmutable())->add($accessTokenTTL));
$accessToken->setPrivateKey($this->privateKey);

foreach ($claims as $claim) {
$accessToken->addClaim($claim);
if (method_exists($accessToken, 'addClaim')) {
foreach ($claims as $claim) {
$accessToken->addClaim($claim);
}
}

while ($maxGenerationAttempts-- > 0) {
Expand Down

0 comments on commit 6710412

Please sign in to comment.