feat: read only gdrive access

This commit is contained in:
karishmas6
2024-10-16 20:11:53 +05:30
parent 0b92b0001e
commit 5264789bba

View File

@@ -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