diff --git a/.RELEASE.md b/.RELEASE.md new file mode 100644 index 00000000..735702b7 --- /dev/null +++ b/.RELEASE.md @@ -0,0 +1 @@ +- Fix TikTok endpoints and `scope` parameter. diff --git a/package.json b/package.json index c94bcdb7..b653b7f6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "arctic", "type": "module", - "version": "3.1.2", + "version": "3.1.3", "description": "OAuth 2.0 clients for popular providers", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/providers/tiktok.ts b/src/providers/tiktok.ts index 7429a99b..6047bd1a 100644 --- a/src/providers/tiktok.ts +++ b/src/providers/tiktok.ts @@ -4,8 +4,8 @@ import { createOAuth2Request, sendTokenRequest, sendTokenRevocationRequest } fro import type { OAuth2Tokens } from "../oauth2.js"; const authorizationEndpoint = "https://www.tiktok.com/v2/auth/authorize"; -const tokenEndpoint = "https://open.tiktokapis.com/v2/oauth/token"; -const tokenRevocationEndpoint = "https://open.tiktokapis.com/v2/oauth/revoke"; +const tokenEndpoint = "https://open.tiktokapis.com/v2/oauth/token/"; +const tokenRevocationEndpoint = "https://open.tiktokapis.com/v2/oauth/revoke/"; export class TikTok { private clientKey: string; @@ -27,7 +27,7 @@ export class TikTok { url.searchParams.set("code_challenge_method", "S256"); url.searchParams.set("code_challenge", codeChallenge); if (scopes.length > 0) { - url.searchParams.set("scope", scopes.join(" ")); + url.searchParams.set("scope", scopes.join(",")); } url.searchParams.set("redirect_uri", this.redirectURI); return url;