Merge pull request #1512 from aztech-dev/oauth-2

Fix undefined method call
This commit is contained in:
Thibaud Fabre
2015-09-25 17:44:16 +02:00

View File

@@ -603,9 +603,12 @@ class API_OAuth2_Adapter extends OAuth2
'state' => null, 'state' => null,
]; ];
$result = [];
if ($params['state'] !== null) { if ($params['state'] !== null) {
$result["query"]["state"] = $params['state']; $result["query"]["state"] = $params['state'];
} }
if ($is_authorized === false) { if ($is_authorized === false) {
$result["query"]["error"] = OAUTH2_ERROR_USER_DENIED; $result["query"]["error"] = OAUTH2_ERROR_USER_DENIED;
} else { } else {
@@ -617,6 +620,7 @@ class API_OAuth2_Adapter extends OAuth2
$result["fragment"] = $this->createAccessToken($params['account_id'], $params['scope']); $result["fragment"] = $this->createAccessToken($params['account_id'], $params['scope']);
} }
} }
$this->doRedirectUriCallback($params['redirect_uri'], $result); $this->doRedirectUriCallback($params['redirect_uri'], $result);
} }
@@ -820,7 +824,7 @@ class API_OAuth2_Adapter extends OAuth2
return [ return [
'redirect_uri' => $this->client->getRedirectUri(), 'redirect_uri' => $this->client->getRedirectUri(),
'client_id' => $this->client->getClient(), 'client_id' => $this->client->getClientId(),
'account_id' => $account->getId(), 'account_id' => $account->getId(),
]; ];
} catch (AccountLockedException $e) { } catch (AccountLockedException $e) {