From 1e4fe089018c633459ff06ac2266c6ab3121a963 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 18 Jan 2020 18:50:07 +0530 Subject: [PATCH] chore: updated bitbucket adapter --- src/Auth/OAuth/Bitbucket.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Auth/OAuth/Bitbucket.php b/src/Auth/OAuth/Bitbucket.php index c0abb6c5d9..9e2a86be69 100644 --- a/src/Auth/OAuth/Bitbucket.php +++ b/src/Auth/OAuth/Bitbucket.php @@ -49,15 +49,17 @@ class Bitbucket extends OAuth { // Required as per Bitbucket Spec. $headers[] = 'Content-Type: application/x-www-form-urlencoded'; - + $accessToken = $this->request( 'POST', 'https://bitbucket.org/site/oauth2/access_token', $headers, - 'code=' . urlencode($code) . - '&client_id=' . urlencode($this->appID) . - '&client_secret=' . urlencode($this->appSecret). - '&grant_type=authorization_code' + http_build_query([ + 'code' => $code, + 'client_id' => $this->appID, + 'client_secret' => $this->appSecret, + 'grant_type' => 'authorization_code' + ]) ); $accessToken = json_decode($accessToken, true);