diff --git a/apps/dashboard/.env.local b/apps/dashboard/.env.local index c2155d01..4911b858 100644 --- a/apps/dashboard/.env.local +++ b/apps/dashboard/.env.local @@ -5,5 +5,5 @@ VITE_CLIENT_URL=http://localhost:3002 VITE_CLIENT_INVITES_URL=http://localhost:3002?inviteCode=\ VITE_ETHEREUM_NETWORK=sepolia VITE_GITHUB_CLIENT_ID=a83a8b014ef38270fb22 -VITE_TWITTER_CLIENT_ID=NV82Mm85NWlSZ1llZkpLMl9vN3A6MTpjaQ +VITE_TWITTER_CLIENT_ID=SUw4TUFiZGJaSXh2ak1YRkx3TFQ6MTpjaQ VITE_TWITTER_REDIRECT_URI=http://localhost:3001/credentials diff --git a/apps/dashboard/.env.production b/apps/dashboard/.env.production index 6a887391..2e458ee6 100644 --- a/apps/dashboard/.env.production +++ b/apps/dashboard/.env.production @@ -5,5 +5,5 @@ VITE_CLIENT_URL=https://client.bandada.pse.dev VITE_CLIENT_INVITES_URL=https://client.bandada.pse.dev?inviteCode=\ VITE_ETHEREUM_NETWORK=sepolia VITE_GITHUB_CLIENT_ID=6ccd7b93e84260e353f9 -VITE_TWITTER_CLIENT_ID=NV82Mm85NWlSZ1llZkpLMl9vN3A6MTpjaQ +VITE_TWITTER_CLIENT_ID=SUw4TUFiZGJaSXh2ak1YRkx3TFQ6MTpjaQ VITE_TWITTER_REDIRECT_URI=https://app.bandada.pse.dev/credentials diff --git a/apps/dashboard/.env.staging b/apps/dashboard/.env.staging index c5b8044e..b14f8b4e 100644 --- a/apps/dashboard/.env.staging +++ b/apps/dashboard/.env.staging @@ -5,5 +5,5 @@ VITE_CLIENT_URL=https://client-staging.bandada.pse.dev VITE_CLIENT_INVITES_URL=https://client-staging.bandada.pse.dev?inviteCode=\ VITE_ETHEREUM_NETWORK=sepolia VITE_GITHUB_CLIENT_ID=6ccd7b93e84260e353f9 -VITE_TWITTER_CLIENT_ID=NV82Mm85NWlSZ1llZkpLMl9vN3A6MTpjaQ +VITE_TWITTER_CLIENT_ID=SUw4TUFiZGJaSXh2ak1YRkx3TFQ6MTpjaQ VITE_TWITTER_REDIRECT_URI=https://app-staging.bandada.pse.dev/credentials diff --git a/libs/credentials/src/providers/twitter/index.ts b/libs/credentials/src/providers/twitter/index.ts index 038fccbc..76070306 100644 --- a/libs/credentials/src/providers/twitter/index.ts +++ b/libs/credentials/src/providers/twitter/index.ts @@ -16,23 +16,20 @@ const provider: Web2Provider = { state: string, redirectUri: string ): Promise { - const { data } = await request( - "https://api.twitter.com/2/oauth2/token", - { - headers: { - "Content-Type": "application/x-www-form-urlencoded", - Authorization: `Basic ${Buffer.from( - `${clientId}:${clientSecret}` - ).toString("base64")}` - }, - method: "POST", - data: - `redirect_uri=${redirectUri}&` + - `grant_type=authorization_code&` + - `code_verifier=${state}&` + - `code=${code}` - } - ) + const data = await request("https://api.twitter.com/2/oauth2/token", { + headers: { + "Content-Type": "application/x-www-form-urlencoded", + Authorization: `Basic ${Buffer.from( + `${clientId}:${clientSecret}` + ).toString("base64")}` + }, + method: "POST", + data: + `redirect_uri=${redirectUri}&` + + `grant_type=authorization_code&` + + `code_verifier=${state}&` + + `code=${code}` + }) return data.access_token },