1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

fix scope not array error

This commit is contained in:
Bishwajeet Parhi 2022-06-09 16:54:33 +00:00
parent 086c9f431e
commit 902baa0bf4

View file

@ -12,21 +12,21 @@ class Dailymotion extends OAuth2
/**
* @var string
*/
private $endpoint = 'https://api.dailymotion.com';
private $authEndpoint = 'https://www.dailymotion.com/oauth/authorize';
private string $endpoint = 'https://api.dailymotion.com';
private string $authEndpoint = 'https://www.dailymotion.com/oauth/authorize';
/**
* @var array
*/
protected $scopes = [
protected array $scopes = [
'userinfo',
'email',
'email'
];
/**
* @var array
*/
protected $fields = [
protected array $fields = [
'avatar_url',
'email',
'first_name',
@ -40,12 +40,12 @@ class Dailymotion extends OAuth2
/**
* @var array
*/
protected $user = [];
protected array $user = [];
/**
* @var array
*/
protected $tokens = [];
protected array $tokens = [];
/**
* @return string
@ -72,15 +72,6 @@ class Dailymotion extends OAuth2
return $url;
}
/**
*
*
* @return array
*/
protected function getFields(): array {
return $this->fields;
}
/**
* @param string $code
*
@ -217,7 +208,7 @@ class Dailymotion extends OAuth2
$this->endpoint . '/user/me?',
['Authorization: Bearer ' . \urlencode($accessToken)],
\http_build_query([
'fields' => \implode(',', $this->getFields())])
'fields' => \implode(',', $fields)])
);
$this->user = \json_decode($user, true);
}