mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Little fixes
This commit is contained in:
parent
f049997f59
commit
5c463a69b8
@ -327,7 +327,6 @@ class Server
|
|||||||
{
|
{
|
||||||
$params = array();
|
$params = array();
|
||||||
|
|
||||||
// Grant type (must be 'authorization_code')
|
|
||||||
if ( ! isset($authParams['grant_type']) && ! isset($_POST['grant_type'])) {
|
if ( ! isset($authParams['grant_type']) && ! isset($_POST['grant_type'])) {
|
||||||
|
|
||||||
throw new OAuthServerClientException(sprintf($this->errors['invalid_request'], 'grant_type'), 0);
|
throw new OAuthServerClientException(sprintf($this->errors['invalid_request'], 'grant_type'), 0);
|
||||||
@ -336,7 +335,7 @@ class Server
|
|||||||
|
|
||||||
$params['grant_type'] = (isset($authParams['grant_type'])) ? $authParams['grant_type'] : $_POST['grant_type'];
|
$params['grant_type'] = (isset($authParams['grant_type'])) ? $authParams['grant_type'] : $_POST['grant_type'];
|
||||||
|
|
||||||
// Ensure response type is one that is recognised
|
// Ensure grant type is one that is recognised
|
||||||
if ( ! in_array($params['grant_type'], $this->grant_types)) {
|
if ( ! in_array($params['grant_type'], $this->grant_types)) {
|
||||||
|
|
||||||
throw new OAuthServerClientException($this->errors['unsupported_grant_type'], 7);
|
throw new OAuthServerClientException($this->errors['unsupported_grant_type'], 7);
|
||||||
@ -349,7 +348,7 @@ class Server
|
|||||||
|
|
||||||
case 'authorization_code': // Authorization code grant
|
case 'authorization_code': // Authorization code grant
|
||||||
return $this->completeAuthCodeGrant($authParams, $params);
|
return $this->completeAuthCodeGrant($authParams, $params);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'refresh_token': // Refresh token
|
case 'refresh_token': // Refresh token
|
||||||
case 'password': // Resource owner password credentials grant
|
case 'password': // Resource owner password credentials grant
|
||||||
|
Loading…
Reference in New Issue
Block a user