fastify / fastify-oauth2

Enable to perform login using oauth2 protocol
MIT License
255 stars 73 forks source link

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

Open charlesread opened 1 year ago

charlesread commented 1 year ago

Prerequisites

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 commented 1 year ago

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