mirror of
https://github.com/appwrite/appwrite
synced 2026-05-18 14:38:35 +00:00
chore: dropbox adapter changes
This commit is contained in:
parent
1e4fe08901
commit
5b5c178b03
1 changed files with 18 additions and 10 deletions
|
|
@ -14,6 +14,11 @@ class Dropbox extends OAuth
|
|||
*/
|
||||
protected $user = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $scopes = [];
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -27,11 +32,12 @@ class Dropbox extends OAuth
|
|||
*/
|
||||
public function getLoginURL(): string
|
||||
{
|
||||
return 'https://www.dropbox.com/oauth2/authorize?'.
|
||||
'client_id='.urlencode($this->appID).
|
||||
'&redirect_uri='.urlencode($this->callback).
|
||||
'&state='.urlencode(json_encode($this->state)).
|
||||
'&response_type=code';
|
||||
return 'https://www.dropbox.com/oauth2/authorize?'.http_build_query([
|
||||
'client_id' => $this->appID,
|
||||
'redirect_uri' => $this->callback,
|
||||
'state' => json_encode($this->state),
|
||||
'response_type' => 'code'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -46,11 +52,13 @@ class Dropbox extends OAuth
|
|||
'POST',
|
||||
'https://api.dropboxapi.com/oauth2/token',
|
||||
$headers,
|
||||
'code='.urlencode($code).
|
||||
'&client_id='.urlencode($this->appID).
|
||||
'&client_secret='.urlencode($this->appSecret).
|
||||
'&redirect_uri='.urlencode($this->callback).
|
||||
'&grant_type=authorization_code'
|
||||
http_build_query([
|
||||
'code' => $code,
|
||||
'client_id' => $this->appID,
|
||||
'client_secret' => $this->appSecret,
|
||||
'redirect_uri' => $this->callback,
|
||||
'grant_type' => 'authorization_code'
|
||||
])
|
||||
);
|
||||
|
||||
$accessToken = json_decode($accessToken, true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue