From f2d064caef43de60c285e22f72476d9d3c14bce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Preu=C3=9F?= Date: Mon, 9 Dec 2019 22:46:23 +0100 Subject: [PATCH] Fix oauth token generation --- src/GhostZero/BitinflowAccounts/Traits/OauthTrait.php | 4 ++-- tests/GhostZero/BitinflowAccounts/ApiOauthTest.php | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/GhostZero/BitinflowAccounts/Traits/OauthTrait.php b/src/GhostZero/BitinflowAccounts/Traits/OauthTrait.php index 11c1904..d75567e 100644 --- a/src/GhostZero/BitinflowAccounts/Traits/OauthTrait.php +++ b/src/GhostZero/BitinflowAccounts/Traits/OauthTrait.php @@ -24,8 +24,8 @@ trait OauthTrait public function retrievingToken(string $grantType, array $attributes): Result { try { - $response = $this->client->request('POST', '/oauth/token', $attributes + [ - 'form_params' => [ + $response = $this->client->request('POST', '/oauth/token', [ + 'form_params' => $attributes + [ 'grant_type' => $grantType, 'client_id' => $this->getClientId(), 'client_secret' => $this->getClientSecret(), diff --git a/tests/GhostZero/BitinflowAccounts/ApiOauthTest.php b/tests/GhostZero/BitinflowAccounts/ApiOauthTest.php index f6a102d..21088d9 100644 --- a/tests/GhostZero/BitinflowAccounts/ApiOauthTest.php +++ b/tests/GhostZero/BitinflowAccounts/ApiOauthTest.php @@ -14,8 +14,6 @@ class ApiOauthTest extends ApiTestCase public function testGetOauthToken(): void { - $this->getClient()->withClientId('5'); - $this->getClient()->withClientSecret('jejmtAJJWeEesW1siWwojjLn6zW9AIcWH1wqfFPq'); $this->registerResult($result = $this->getClient()->retrievingToken('client_credentials', [ 'scope' => '', ]));