mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 09:01:17 +00:00
Add temporary debug logging to GitHub OAuth exchange
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
32a48131b5
commit
c410e24057
1 changed files with 19 additions and 6 deletions
|
|
@ -161,21 +161,34 @@ export class GitHubAppClient {
|
|||
throw new GitHubAppError("GitHub OAuth is not configured", 500);
|
||||
}
|
||||
|
||||
const exchangeBody = {
|
||||
client_id: this.clientId,
|
||||
client_secret: this.clientSecret,
|
||||
code,
|
||||
redirect_uri: this.redirectUri,
|
||||
};
|
||||
console.log("[github-oauth] exchangeCode request", {
|
||||
url: `${this.authBaseUrl}/login/oauth/access_token`,
|
||||
client_id: this.clientId,
|
||||
redirect_uri: this.redirectUri,
|
||||
code_length: code.length,
|
||||
code_prefix: code.slice(0, 6),
|
||||
});
|
||||
|
||||
const response = await fetch(`${this.authBaseUrl}/login/oauth/access_token`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
client_id: this.clientId,
|
||||
client_secret: this.clientSecret,
|
||||
code,
|
||||
redirect_uri: this.redirectUri,
|
||||
}),
|
||||
body: JSON.stringify(exchangeBody),
|
||||
});
|
||||
|
||||
const responseText = await response.text();
|
||||
console.log("[github-oauth] exchangeCode response", {
|
||||
status: response.status,
|
||||
body: responseText.slice(0, 300),
|
||||
});
|
||||
let payload: GitHubTokenResponse;
|
||||
try {
|
||||
payload = JSON.parse(responseText) as GitHubTokenResponse;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue