From 5264789bba7508212fa7187558a50e609724c402 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 16 Oct 2024 20:11:53 +0530 Subject: [PATCH] feat: read only gdrive access --- server/src/routes/auth.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/routes/auth.ts b/server/src/routes/auth.ts index eb9a4bbe..9b3c98a0 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -173,7 +173,11 @@ const oauth2Client = new google.auth.OAuth2( // Step 1: Redirect to Google for authentication router.get('/google', (req, res) => { - const scopes = ['https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/userinfo.email']; + const scopes = [ + 'https://www.googleapis.com/auth/spreadsheets', + 'https://www.googleapis.com/auth/userinfo.email', + 'https://www.googleapis.com/auth/drive.readonly', + ]; const url = oauth2Client.generateAuthUrl({ access_type: 'offline', prompt: 'consent', // Ensures you get a refresh token on first login