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.
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 tosimple-oauth2
's.createToken()
method, which expects an AccessToken object, itself with arefresh_token
property, that can be successfully used..getNewAccessTokenUsingRefreshToken({refresh_token: 'eyJhbGciOiJSUzI1NiI...'})
works just fine.