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

how to use refresh token to get a new access token ? #103

Open
IWTBCAdeveloper opened this issue Nov 21, 2019 · 0 comments
Open

how to use refresh token to get a new access token ? #103

IWTBCAdeveloper opened this issue Nov 21, 2019 · 0 comments

Comments

@IWTBCAdeveloper
Copy link

Hi, there

I use twitter strategy like below

const twitterStrategy = new TwitterStrategy({
  consumerKey: TWITTER_APP_ID,
  consumerSecret: TWITTER_APP_SECRET,
  callbackURL: TWITTER_CALLBACK_URL,
  userProfileURL: 'https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true',
  includeEmail: true,
}, createOrUpdate)

and use passport-oauth2-refresh to refresh token when access token is expires

passport.use (twitterStrategy)
refresh.use (twitterStrategy)

but it throws an error

throw new Error('Cannot register: not an OAuth2 strategy');

what should I do now and what should I do to refresh access token, please help T.T

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

1 participant