getUser and related, temp, respond empty
This commit is contained in:
parent
5d5a7b88e0
commit
7d66e995c3
1 changed files with 0 additions and 21 deletions
|
@ -164,12 +164,6 @@ class Notion extends OAuth2
|
||||||
*/
|
*/
|
||||||
public function getUserEmail(string $accessToken):string
|
public function getUserEmail(string $accessToken):string
|
||||||
{
|
{
|
||||||
$response = $this->getUser($accessToken);
|
|
||||||
|
|
||||||
if(isset($response['bot']['owner']['user']['person']['email'])){
|
|
||||||
return $response['bot']['owner']['user']['person']['email'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,12 +174,6 @@ class Notion extends OAuth2
|
||||||
*/
|
*/
|
||||||
public function getUserName(string $accessToken):string
|
public function getUserName(string $accessToken):string
|
||||||
{
|
{
|
||||||
$response = $this->getUser($accessToken);
|
|
||||||
|
|
||||||
if (isset($response['bot']['owner']['user']['name'])) {
|
|
||||||
return $response['bot']['owner']['user']['name'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,15 +184,6 @@ class Notion extends OAuth2
|
||||||
*/
|
*/
|
||||||
protected function getUser(string $accessToken)
|
protected function getUser(string $accessToken)
|
||||||
{
|
{
|
||||||
$headers = [
|
|
||||||
'Notion-Version: ' . $this->version,
|
|
||||||
'Authorization: Bearer '.\urlencode($accessToken)
|
|
||||||
];
|
|
||||||
|
|
||||||
if (empty($this->user)) {
|
|
||||||
$this->user = \json_decode($this->request('GET', $this->endpoint . '/users/me', $headers), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue