Implement getUser method

This commit is contained in:
Everly Precia Suresh
2022-09-19 13:36:25 +00:00
parent e051cbcc87
commit 96e9ea0146
+6 -1
View File
@@ -153,7 +153,12 @@ class Line extends OAuth2
*/
protected function getUser(string $accessToken): array
{
if (empty($this->user)) {
$headers = ['Authorization: Bearer ' . \urlencode($accessToken)];
$user = $this->request('GET', 'https://api.line.me/v2/profile', $headers);
$this->user = \json_decode($user, true);
}
return [];
return $this->user;
}
}