mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Add explanatory comments for TikTok-specific OAuth implementation details
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
This commit is contained in:
co-authored by
stnguyen90
parent
2c866b848f
commit
cd1e6c8d85
@@ -52,7 +52,7 @@ class TikTok extends OAuth2
|
||||
return $this->endpoint . '?' .
|
||||
\http_build_query([
|
||||
'client_key' => $this->appID,
|
||||
'scope' => \implode(',', $this->getScopes()),
|
||||
'scope' => \implode(',', $this->getScopes()), // TikTok uses comma separator for scopes
|
||||
'response_type' => 'code',
|
||||
'redirect_uri' => $this->callback,
|
||||
'state' => \json_encode($this->state)
|
||||
@@ -141,6 +141,7 @@ class TikTok extends OAuth2
|
||||
{
|
||||
$user = $this->getUser($accessToken);
|
||||
|
||||
// TikTok does not provide email with the basic scope
|
||||
return $user['email'] ?? '';
|
||||
}
|
||||
|
||||
@@ -183,6 +184,7 @@ class TikTok extends OAuth2
|
||||
'Content-Type: application/json',
|
||||
];
|
||||
|
||||
// Fetch basic user info fields as required by TikTok API
|
||||
$response = $this->request(
|
||||
'GET',
|
||||
$this->apiEndpoint . '/v2/user/info/?fields=open_id,union_id,avatar_url,display_name',
|
||||
|
||||
Reference in New Issue
Block a user