From 4cc4970f6df0e02381a82f4804bfc5aeede4a787 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sat, 28 Jan 2023 23:56:06 -0800 Subject: [PATCH] Move OAuth scopes into the function --- functions/atom.xml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/atom.xml.js b/functions/atom.xml.js index c97b677..2bb6134 100644 --- a/functions/atom.xml.js +++ b/functions/atom.xml.js @@ -3,7 +3,7 @@ import { getGoogleAuthToken } from './auth.js'; export async function onRequestGet({ env }) { const entries = []; const updatedDates = []; - const token = await getGoogleAuthToken(env.EMAIL, env.PRIVATE_KEY, env.SCOPES); + const token = await getGoogleAuthToken(env.EMAIL, env.PRIVATE_KEY, 'https://www.googleapis.com/auth/spreadsheets.readonly https://www.googleapis.com/auth/documents.readonly'); const sheetUrl = 'https://sheets.googleapis.com/v4/spreadsheets/1pfGF8yBu3D0GPTezygLuzu3Cif8SkjhtG98nL-czlhc/values/B3:I'; await fetch(sheetUrl, { headers: { Authorization: `Bearer ${token}` } }) .then(r => r.json()) -- 2.47.3