Skip to content

Commit

Permalink
Fixed problems getting token with grant type
Browse files Browse the repository at this point in the history
  • Loading branch information
schiggi authored Oct 2, 2018
1 parent 061f814 commit 7a80f46
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/OAuth2/Controller/TokenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ public function grantAccessToken(RequestInterface $request, ResponseInterface $r
* and validate the request for that grant type
*/
if (!$grantTypeIdentifier = $request->request('grant_type')) {
$response->setError(400, 'invalid_request', 'The grant type was not specified in the request');
if (!$grantTypeIdentifier = $request->query('grant_type')) {
$response->setError(400, 'invalid_request', 'The grant type was not specified in the request');

return null;
return null;
}
}

if (!isset($this->grantTypes[$grantTypeIdentifier])) {
Expand Down

2 comments on commit 7a80f46

@ahmadkarim
Copy link

Choose a reason for hiding this comment

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

can you please explain

@ahmadkarim
Copy link

Choose a reason for hiding this comment

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

no need to, just saw the description now:)

Please sign in to comment.