Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent onTokenRefreshError event #1

Open
dev-bre opened this issue Dec 9, 2022 · 5 comments
Open

Intermittent onTokenRefreshError event #1

dev-bre opened this issue Dec 9, 2022 · 5 comments

Comments

@dev-bre
Copy link

dev-bre commented Dec 9, 2022

Hi,

even thought this lib works 90% of the time, I am observing intermittent failures (code 400) when refreshing the tokens.

here it is my code:

 const autoRefresherPlugin = new TwitterApiAutoTokenRefresher({
        refreshToken: currentUser.tokenRefresh,
        refreshCredentials: { clientId: TWITTER_CLIENT_ID, clientSecret: TWITTER_CLIENT_SECRET },
        onTokenUpdate(token) {
          // Saving new trokens in DB
        },
        onTokenRefreshError(error) {
            console.error(`generateTwitterClient: Refresh error user: ${currentUser.name}`, error)
        },
    })

    return new TwitterApi(currentUser.token, { plugins: [autoRefresherPlugin] })

Can you please advice? what is the best thing to do when that error happens?

@bielmorales
Copy link

Up! Same here

@ootsun
Copy link

ootsun commented Apr 12, 2023

Did you found a work around?

@ootsun
Copy link

ootsun commented Apr 12, 2023

@jmcoder1
Copy link

Did you find a work around? I have the same problem.

@ootsun
Copy link

ootsun commented May 10, 2023

No, I'm still waiting for someone from Twitter to answer this blog post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants