Merge pull request #362 from automatisch/refactor/use-twitter-api-v2-to-verify

refactor: Use twitter api v2 endpoint to verify authentication
This commit is contained in:
Ömer Faruk Aydın
2022-07-27 11:20:16 +03:00
committed by GitHub

View File

@@ -106,7 +106,7 @@ export default class Authentication implements IAuthentication {
}; };
const requestData = { const requestData = {
url: `${Authentication.baseUrl}/1.1/account/verify_credentials.json`, url: `${Authentication.baseUrl}/2/users/me`,
method: 'GET', method: 'GET',
}; };
@@ -114,7 +114,7 @@ export default class Authentication implements IAuthentication {
this.oauthClient.authorize(requestData, token) this.oauthClient.authorize(requestData, token)
); );
await this.client.get(`/1.1/account/verify_credentials.json`, { await this.client.get(`/2/users/me`, {
headers: { ...authHeader }, headers: { ...authHeader },
}); });