]> git.ardis.lu - ardislu.dev/commitdiff
Move OAuth scopes into the function
authorArdis Lu <ardisglu@gmail.com>
Sun, 29 Jan 2023 07:56:06 +0000 (23:56 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sun, 29 Jan 2023 07:56:06 +0000 (23:56 -0800)
functions/atom.xml.js

index c97b67703a20037c87bcbb07558cf6165776a495..2bb61348d097da882c8e64a9fb2ffbd277c6037e 100644 (file)
@@ -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())
This page took 0.035327 seconds and 4 git commands to generate.