fastify / fastify/fastify-oauth2

`tokenRequestParams` should be passed into `OAuth2Token#refresh`

Open
#292 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
319
Forks
74
Avg merge
7h 16m
Merged PRs (30d)
1

Description

### Prerequisites

- [x] I have written a descriptive issue title
- [x] I have searched existing issues to ensure the bug has not already been reported

### Fastify version

5.2.1

### Plugin version

8.1.2

### Node.js version

22.13.1

### Operating system

macOS

### Operating system version (i.e. 20.04, 11.3, 10)

15.3.1

### Description

👋 As the README notes, when working with Twitch, one has to set `tokenRequestParams` in the plugin options to allow OAuth to work correctly.

_However_, the `refresh` method exposed on a returned token does not make use of `tokenRequestParams`, so one has to pass them in manually again.

Similarly, the `getNewAccessTokenUsingRefreshToken` method exposed on the plugin instance itself does not make use of `tokenRequestParams`.

### Link to code that reproduces the bug

https://gist.github.com/MattIPv4/816c5692f822c5a18aaa11d37d7b5536

### Expected Behavior

If `tokenRequestParams` is provided, it should be passed in automatically for all the token requests.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.