Skip to content

Commit

Permalink
doc: fix missing async on OAuth2 login (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
b1617 authored Mar 17, 2022
1 parent 23b0706 commit c852d05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ app.get('/callback', (req, res) => {
const client = new TwitterApi({ clientId: CLIENT_ID, clientSecret: CLIENT_SECRET });

client.loginWithOAuth2({ code, codeVerifier, redirectUri: CALLBACK_URL })
.then(({ client: loggedClient, accessToken, refreshToken, expiresIn }) => {
.then(async({ client: loggedClient, accessToken, refreshToken, expiresIn }) => {
// {loggedClient} is an authenticated client in behalf of some user
// Store {accessToken} somewhere, it will be valid until {expiresIn} is hit.
// If you want to refresh your token later, store {refreshToken} (it is present if 'offline.access' has been given as scope)
Expand Down

0 comments on commit c852d05

Please sign in to comment.