Skip to content

Commit

Permalink
fixes #547 - ensures Grant Type identifier is passed to tokencontroller
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed May 9, 2015
1 parent 1f91815 commit 49bc005
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/OAuth2/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,17 @@ public function getAccessTokenData(RequestInterface $request, ResponseInterface
return $value;
}

public function addGrantType(GrantTypeInterface $grantType, $key = null)
public function addGrantType(GrantTypeInterface $grantType, $identifier = null)
{
if (is_string($key)) {
$this->grantTypes[$key] = $grantType;
} else {
$this->grantTypes[$grantType->getQuerystringIdentifier()] = $grantType;
if (!is_string($identifier)) {
$identifier = $grantType->getQuerystringIdentifier();
}

$this->grantTypes[$identifier] = $grantType;

// persist added grant type down to TokenController
if (!is_null($this->tokenController)) {
$this->getTokenController()->addGrantType($grantType);
$this->getTokenController()->addGrantType($grantType, $identifier);
}
}

Expand Down

1 comment on commit 49bc005

@martyncrow
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this will fix it, excellent thank you.

Please sign in to comment.