fix getUser method

This commit is contained in:
Bishwajeet Parhi 2022-06-12 07:16:01 +00:00
parent 7819b19d1c
commit 104f976f1b

View file

@ -206,16 +206,13 @@ class Dailymotion extends OAuth2
* *
* @return array * @return array
*/ */
protected function getUser(string $accessToken) : array protected function getUser(string $accessToken): array
{ {
if (empty($this->user)) { if (empty($this->user)) {
$user = $this->request( $user = $this->request(
'GET', 'GET',
$this->endpoint . '/user/me?', $this->endpoint . '/user/me?fields=' . \implode(',', $this->getFields()),
['Authorization: Bearer ' . \urlencode($accessToken)], ['Authorization: Bearer ' . \urlencode($accessToken)],
\http_build_query([
'fields' => \implode(' ', $this->getFields())
])
); );
$this->user = \json_decode($user, true); $this->user = \json_decode($user, true);
\var_dump($this->user); \var_dump($this->user);