refactor: Use twitter api v2 endpoint to verify authentication

This commit is contained in:
Faruk AYDIN
2022-07-27 00:49:19 +03:00
parent 18cdd226bb
commit 04450b8793

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 },
}); });