mirror of
https://github.com/appwrite/appwrite
synced 2026-05-06 06:48:22 +00:00
feat: Dropbox OAuth Added
This commit is contained in:
parent
44c179bb02
commit
4e6541b8f6
1 changed files with 8 additions and 7 deletions
|
|
@ -72,8 +72,8 @@ class Dropbox extends OAuth
|
|||
{
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
if (isset($user['id'])) {
|
||||
return $user['id'];
|
||||
if (isset($user['account_id'])) {
|
||||
return $user['account_id'];
|
||||
}
|
||||
|
||||
return '';
|
||||
|
|
@ -88,8 +88,8 @@ class Dropbox extends OAuth
|
|||
{
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
if (isset($user['userPrincipalName'])) {
|
||||
return $user['userPrincipalName'];
|
||||
if (isset($user['email'])) {
|
||||
return $user['email'];
|
||||
}
|
||||
|
||||
return '';
|
||||
|
|
@ -104,8 +104,8 @@ class Dropbox extends OAuth
|
|||
{
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
if (isset($user['displayName'])) {
|
||||
return $user['displayName'];
|
||||
if (isset($user['name'])) {
|
||||
return $user['name']['display_name'];
|
||||
}
|
||||
|
||||
return '';
|
||||
|
|
@ -120,8 +120,9 @@ class Dropbox extends OAuth
|
|||
{
|
||||
if (empty($this->user)) {
|
||||
$headers[] = 'Authorization: Bearer '. urlencode($accessToken);
|
||||
$user = $this->request('GET', 'https://api.dropboxapi.com/2/users/get_current_account', $headers);
|
||||
$user = $this->request('POST', 'https://api.dropboxapi.com/2/users/get_current_account', $headers);
|
||||
$this->user = json_decode($user, true);
|
||||
|
||||
}
|
||||
|
||||
return $this->user;
|
||||
|
|
|
|||
Loading…
Reference in a new issue