mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +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);
|
$user = $this->getUser($accessToken);
|
||||||
|
|
||||||
if (isset($user['id'])) {
|
if (isset($user['account_id'])) {
|
||||||
return $user['id'];
|
return $user['account_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -88,8 +88,8 @@ class Dropbox extends OAuth
|
||||||
{
|
{
|
||||||
$user = $this->getUser($accessToken);
|
$user = $this->getUser($accessToken);
|
||||||
|
|
||||||
if (isset($user['userPrincipalName'])) {
|
if (isset($user['email'])) {
|
||||||
return $user['userPrincipalName'];
|
return $user['email'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -104,8 +104,8 @@ class Dropbox extends OAuth
|
||||||
{
|
{
|
||||||
$user = $this->getUser($accessToken);
|
$user = $this->getUser($accessToken);
|
||||||
|
|
||||||
if (isset($user['displayName'])) {
|
if (isset($user['name'])) {
|
||||||
return $user['displayName'];
|
return $user['name']['display_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -120,8 +120,9 @@ class Dropbox extends OAuth
|
||||||
{
|
{
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$headers[] = 'Authorization: Bearer '. urlencode($accessToken);
|
$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);
|
$this->user = json_decode($user, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->user;
|
return $this->user;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue