Skip to content

Commit 821de7f

Browse files
lsr911claude
andcommitted
fix(google): restore missing variable assignments in oauth.project.ts
The batch script replaced await response.json() but dropped the const declarations, causing 'data' and 'errorPayload' to be undefined at runtime. Also removed the duplicate readResponseWithLimit import. Co-Authored-By: Claude <[email protected]>
1 parent fbe8946 commit 821de7f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

extensions/google/oauth.project.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Google plugin module implements oauth.project behavior.
22
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
3-
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
43
import { fetchWithTimeout } from "./oauth.http.js";
54
import {
65
CODE_ASSIST_ENDPOINT_PROD,
@@ -25,7 +24,7 @@ async function getUserEmail(accessToken: string): Promise<string | undefined> {
2524
headers: { Authorization: `Bearer ${accessToken}` },
2625
});
2726
if (response.ok) {
28-
JSON.parse(
27+
const data = JSON.parse(
2928
(await readResponseWithLimit(response, GOOGLE_OAUTH_PROJECT_JSON_RESPONSE_MAX_BYTES, {
3029
onOverflow: ({ maxBytes }) =>
3130
new Error(`Google OAuth project JSON response exceeds ${maxBytes} bytes`),
@@ -83,7 +82,7 @@ async function pollOperation(
8382
if (!response.ok) {
8483
continue;
8584
}
86-
JSON.parse(
85+
const data = JSON.parse(
8786
(await readResponseWithLimit(response, GOOGLE_OAUTH_PROJECT_JSON_RESPONSE_MAX_BYTES, {
8887
onOverflow: ({ maxBytes }) =>
8988
new Error(`Google OAuth project JSON response exceeds ${maxBytes} bytes`),
@@ -149,7 +148,7 @@ async function discoverProject(accessToken: string): Promise<string> {
149148
});
150149

151150
if (!response.ok) {
152-
JSON.parse(
151+
const errorPayload = JSON.parse(
153152
(await readResponseWithLimit(response, GOOGLE_OAUTH_PROJECT_JSON_RESPONSE_MAX_BYTES, {
154153
onOverflow: ({ maxBytes }) =>
155154
new Error(`Google OAuth project JSON response exceeds ${maxBytes} bytes`),

0 commit comments

Comments
 (0)