From cd1e6c8d8591bd9f13e9fa6dc2803859e714247e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 22:28:24 +0000 Subject: [PATCH] Add explanatory comments for TikTok-specific OAuth implementation details Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com> --- src/Appwrite/Auth/OAuth2/TikTok.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Auth/OAuth2/TikTok.php b/src/Appwrite/Auth/OAuth2/TikTok.php index 4dadd6093e..4ee7158231 100644 --- a/src/Appwrite/Auth/OAuth2/TikTok.php +++ b/src/Appwrite/Auth/OAuth2/TikTok.php @@ -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',