fix: add missing clientId to github provider config for OAuth token refresh (#442)

The github provider in open-sse/config/providers.js was missing clientId,
causing refreshGitHubToken() to send client_id=undefined on 401 retry.
Also guard against undefined clientSecret in both refresh implementations.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Manuel B.
2026-03-30 07:24:31 +02:00
committed by GitHub
parent e6299eef56
commit cd1e06b641
3 changed files with 22 additions and 13 deletions

View File

@@ -243,15 +243,19 @@ export class GithubExecutor extends BaseExecutor {
async refreshGitHubToken(refreshToken, log) {
try {
const params = {
grant_type: "refresh_token",
refresh_token: refreshToken,
client_id: this.config.clientId,
};
if (this.config.clientSecret) {
params.client_secret = this.config.clientSecret;
}
const response = await fetch(OAUTH_ENDPOINTS.github.token, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json" },
body: new URLSearchParams({
grant_type: "refresh_token",
refresh_token: refreshToken,
client_id: this.config.clientId,
client_secret: this.config.clientSecret
})
body: new URLSearchParams(params)
});
if (!response.ok) return null;
const tokens = await response.json();