mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +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 = [];
|
protected $user = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $scopes = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
@ -27,11 +32,12 @@ class Dropbox extends OAuth
|
||||||
*/
|
*/
|
||||||
public function getLoginURL(): string
|
public function getLoginURL(): string
|
||||||
{
|
{
|
||||||
return 'https://www.dropbox.com/oauth2/authorize?'.
|
return 'https://www.dropbox.com/oauth2/authorize?'.http_build_query([
|
||||||
'client_id='.urlencode($this->appID).
|
'client_id' => $this->appID,
|
||||||
'&redirect_uri='.urlencode($this->callback).
|
'redirect_uri' => $this->callback,
|
||||||
'&state='.urlencode(json_encode($this->state)).
|
'state' => json_encode($this->state),
|
||||||
'&response_type=code';
|
'response_type' => 'code'
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -46,11 +52,13 @@ class Dropbox extends OAuth
|
||||||
'POST',
|
'POST',
|
||||||
'https://api.dropboxapi.com/oauth2/token',
|
'https://api.dropboxapi.com/oauth2/token',
|
||||||
$headers,
|
$headers,
|
||||||
'code='.urlencode($code).
|
http_build_query([
|
||||||
'&client_id='.urlencode($this->appID).
|
'code' => $code,
|
||||||
'&client_secret='.urlencode($this->appSecret).
|
'client_id' => $this->appID,
|
||||||
'&redirect_uri='.urlencode($this->callback).
|
'client_secret' => $this->appSecret,
|
||||||
'&grant_type=authorization_code'
|
'redirect_uri' => $this->callback,
|
||||||
|
'grant_type' => 'authorization_code'
|
||||||
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
$accessToken = json_decode($accessToken, true);
|
$accessToken = json_decode($accessToken, true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue