Skip to content

Commit 2465101

Browse files
authored
fox(providers): Downgrade requested OAuth scope of TikTok provider (#12608)
* Downgrade requested OAuth scope of TikTok provider The provider is currently requesting a token with `user.info.profile` scope, which is more restrictive than `user.info.basic`. The latter is the one provided by default by the TikTok Login kit and as such, should be the one used for authentication purposes with TikTok. The user info requested by the provider is also covered by the `user.info.basic` scope. For this reason, this PR changes the requested scope to `user.info.basic`. * Update tiktok.ts Do not request user_name
1 parent 324fd6f commit 2465101

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/core/src/providers/tiktok.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,21 @@ export default function TikTok(
293293
url: "https://www.tiktok.com/v2/auth/authorize",
294294
params: {
295295
client_key: options.clientId,
296-
scope: "user.info.profile",
296+
scope: "user.info.basic",
297297
},
298298
},
299299

300300
token: "https://open.tiktokapis.com/v2/oauth/token/",
301301
userinfo:
302-
"https://open.tiktokapis.com/v2/user/info/?fields=open_id,avatar_url,display_name,username",
302+
"https://open.tiktokapis.com/v2/user/info/?fields=open_id,avatar_url,display_name",
303303

304304
profile(profile) {
305305
return {
306306
id: profile.data.user.open_id,
307307
name: profile.data.user.display_name,
308308
image: profile.data.user.avatar_url,
309-
email: profile.data.user.email || profile.data.user.username || null,
309+
// Email address is not supported by TikTok.
310+
email: null,
310311
}
311312
},
312313
style: {

0 commit comments

Comments
 (0)