mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-21 17:00:49 +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);
|
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`, {
|
const response = await fetch(`${this.authBaseUrl}/login/oauth/access_token`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify(exchangeBody),
|
||||||
client_id: this.clientId,
|
|
||||||
client_secret: this.clientSecret,
|
|
||||||
code,
|
|
||||||
redirect_uri: this.redirectUri,
|
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const responseText = await response.text();
|
const responseText = await response.text();
|
||||||
|
console.log("[github-oauth] exchangeCode response", {
|
||||||
|
status: response.status,
|
||||||
|
body: responseText.slice(0, 300),
|
||||||
|
});
|
||||||
let payload: GitHubTokenResponse;
|
let payload: GitHubTokenResponse;
|
||||||
try {
|
try {
|
||||||
payload = JSON.parse(responseText) as GitHubTokenResponse;
|
payload = JSON.parse(responseText) as GitHubTokenResponse;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue