From fff8ab466068cda6721f712fb6bc45207408d7a2 Mon Sep 17 00:00:00 2001 From: Nestor Qin Date: Thu, 24 Oct 2024 18:01:12 -0400 Subject: [PATCH] fix: typo in variable name `token` in Google tools --- src/action.ts | 7 ++++--- src/retriever.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/action.ts b/src/action.ts index 3f0c976..52c71d6 100644 --- a/src/action.ts +++ b/src/action.ts @@ -65,6 +65,7 @@ export async function createGoogleCalendarEvent( if (!token) { // try to get token by using Chrome Identity API + console.log("`token` not specified, trying retrieving through Google identity API OAuth flow...") try { const authResult = await chrome.identity.getAuthToken({ interactive: true, @@ -90,11 +91,11 @@ export async function createGoogleCalendarEvent( description: parameters.description || "", start: { dateTime: parameters.startDateTime, - timeZone, // Adjust this according to the user's time zone + timeZone, }, end: { dateTime: parameters.endDateTime, - timeZone, // Adjust this according to the user's time zone + timeZone, }, }; @@ -104,7 +105,7 @@ export async function createGoogleCalendarEvent( { method: "POST", headers: { - Authorization: `Bearer ${parameters.token}`, + Authorization: `Bearer ${token}`, "Content-Type": "application/json", }, body: JSON.stringify(event), diff --git a/src/retriever.ts b/src/retriever.ts index 0fdb110..d28a01c 100644 --- a/src/retriever.ts +++ b/src/retriever.ts @@ -47,7 +47,7 @@ export async function getCalendarEvents( const response = await fetch(url, { method: "GET", headers: { - Authorization: `Bearer ${parameters.token}`, + Authorization: `Bearer ${token}`, "Content-Type": "application/json", }, });