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

getNewAccessTokenUsingRefreshToken(refreshToken, params, callback) doc and signature are slightly misleading #197

Open
2 tasks done
charlesread opened this issue Mar 24, 2023 · 1 comment

Comments

@charlesread
Copy link

charlesread commented Mar 24, 2023

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

The documentation for this method (https://github.com/fastify/fastify-oauth2/blob/master/README.md?plain=1#L230) gives the impression that refreshToken is a string that is the actual refresh token ("eyJhbGciOiJSUzI1NiI...").

Howerver, refreshToken gets passed to simple-oauth2's .createToken() method, which expects an AccessToken object, itself with a refresh_token property, that can be successfully used.

.getNewAccessTokenUsingRefreshToken({refresh_token: 'eyJhbGciOiJSUzI1NiI...'}) works just fine.

@Eomm
Copy link
Member

Eomm commented Mar 25, 2023

Thanks for reporting!
Would you like to send a Pull Request to address this issue?

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

2 participants