From 96e9ea014692e437a502375ea88e2b20b3983469 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Mon, 19 Sep 2022 13:36:25 +0000 Subject: [PATCH] Implement getUser method --- src/Appwrite/Auth/OAuth2/Line.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Auth/OAuth2/Line.php b/src/Appwrite/Auth/OAuth2/Line.php index 751af897a0..0c319991f1 100644 --- a/src/Appwrite/Auth/OAuth2/Line.php +++ b/src/Appwrite/Auth/OAuth2/Line.php @@ -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; } }