diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx index aa31d8ea1c..34530ab9c0 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx @@ -37,6 +37,7 @@ const SCOPE_DESCRIPTIONS: Record = { 'https://www.googleapis.com/auth/gmail.labels': 'View and manage your email labels', 'https://www.googleapis.com/auth/gmail.modify': 'View and manage your email messages', 'https://www.googleapis.com/auth/drive.file': 'View and manage your Google Drive files', + 'https://www.googleapis.com/auth/drive': 'Full access to all your Google Drive files', 'https://www.googleapis.com/auth/calendar': 'View and manage your calendar', 'https://www.googleapis.com/auth/userinfo.email': 'View your email address', 'https://www.googleapis.com/auth/userinfo.profile': 'View your basic profile info', diff --git a/apps/sim/blocks/blocks/google_docs.ts b/apps/sim/blocks/blocks/google_docs.ts index 9f85f1c45d..78d2307ed5 100644 --- a/apps/sim/blocks/blocks/google_docs.ts +++ b/apps/sim/blocks/blocks/google_docs.ts @@ -35,7 +35,10 @@ export const GoogleDocsBlock: BlockConfig = { required: true, provider: 'google-docs', serviceId: 'google-docs', - requiredScopes: ['https://www.googleapis.com/auth/drive.file'], + requiredScopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], placeholder: 'Select Google account', }, // Document selector (basic mode) diff --git a/apps/sim/blocks/blocks/google_drive.ts b/apps/sim/blocks/blocks/google_drive.ts index a8885a4811..2cd8a568ce 100644 --- a/apps/sim/blocks/blocks/google_drive.ts +++ b/apps/sim/blocks/blocks/google_drive.ts @@ -36,7 +36,10 @@ export const GoogleDriveBlock: BlockConfig = { required: true, provider: 'google-drive', serviceId: 'google-drive', - requiredScopes: ['https://www.googleapis.com/auth/drive.file'], + requiredScopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], placeholder: 'Select Google Drive account', }, // Create/Upload File Fields @@ -103,7 +106,10 @@ export const GoogleDriveBlock: BlockConfig = { canonicalParamId: 'folderId', provider: 'google-drive', serviceId: 'google-drive', - requiredScopes: ['https://www.googleapis.com/auth/drive.file'], + requiredScopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], mimeType: 'application/vnd.google-apps.folder', placeholder: 'Select a parent folder', mode: 'basic', @@ -173,7 +179,10 @@ export const GoogleDriveBlock: BlockConfig = { canonicalParamId: 'folderId', provider: 'google-drive', serviceId: 'google-drive', - requiredScopes: ['https://www.googleapis.com/auth/drive.file'], + requiredScopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], mimeType: 'application/vnd.google-apps.folder', placeholder: 'Select a parent folder', mode: 'basic', @@ -198,7 +207,10 @@ export const GoogleDriveBlock: BlockConfig = { canonicalParamId: 'folderId', provider: 'google-drive', serviceId: 'google-drive', - requiredScopes: ['https://www.googleapis.com/auth/drive.file'], + requiredScopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], mimeType: 'application/vnd.google-apps.folder', placeholder: 'Select a folder to list files from', mode: 'basic', @@ -237,7 +249,10 @@ export const GoogleDriveBlock: BlockConfig = { canonicalParamId: 'fileId', provider: 'google-drive', serviceId: 'google-drive', - requiredScopes: ['https://www.googleapis.com/auth/drive.file'], + requiredScopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], placeholder: 'Select a file to download', mode: 'basic', dependsOn: ['credential'], diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index 6d16a27470..6657973601 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -36,7 +36,10 @@ export const GoogleSheetsBlock: BlockConfig = { required: true, provider: 'google-sheets', serviceId: 'google-sheets', - requiredScopes: ['https://www.googleapis.com/auth/drive.file'], + requiredScopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], placeholder: 'Select Google account', }, // Spreadsheet Selector @@ -47,7 +50,10 @@ export const GoogleSheetsBlock: BlockConfig = { canonicalParamId: 'spreadsheetId', provider: 'google-sheets', serviceId: 'google-sheets', - requiredScopes: ['https://www.googleapis.com/auth/drive.file'], + requiredScopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], mimeType: 'application/vnd.google-apps.spreadsheet', placeholder: 'Select a spreadsheet', dependsOn: ['credential'], diff --git a/apps/sim/lib/auth.ts b/apps/sim/lib/auth.ts index b4ff5b4655..e3d7f544ef 100644 --- a/apps/sim/lib/auth.ts +++ b/apps/sim/lib/auth.ts @@ -430,6 +430,7 @@ export const auth = betterAuth({ 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', ], prompt: 'consent', redirectURI: `${getBaseUrl()}/api/auth/oauth2/callback/google-drive`, @@ -444,6 +445,7 @@ export const auth = betterAuth({ 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', ], prompt: 'consent', redirectURI: `${getBaseUrl()}/api/auth/oauth2/callback/google-docs`, @@ -458,6 +460,7 @@ export const auth = betterAuth({ 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', ], prompt: 'consent', redirectURI: `${getBaseUrl()}/api/auth/oauth2/callback/google-sheets`, diff --git a/apps/sim/lib/oauth/oauth.ts b/apps/sim/lib/oauth/oauth.ts index 3a8dfd4866..41145c3bf8 100644 --- a/apps/sim/lib/oauth/oauth.ts +++ b/apps/sim/lib/oauth/oauth.ts @@ -140,7 +140,10 @@ export const OAUTH_PROVIDERS: Record = { providerId: 'google-drive', icon: (props) => GoogleDriveIcon(props), baseProviderIcon: (props) => GoogleIcon(props), - scopes: ['https://www.googleapis.com/auth/drive.file'], + scopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], scopeHints: ['drive'], }, 'google-docs': { @@ -150,7 +153,10 @@ export const OAUTH_PROVIDERS: Record = { providerId: 'google-docs', icon: (props) => GoogleDocsIcon(props), baseProviderIcon: (props) => GoogleIcon(props), - scopes: ['https://www.googleapis.com/auth/drive.file'], + scopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], scopeHints: ['docs'], }, 'google-sheets': { @@ -160,7 +166,10 @@ export const OAUTH_PROVIDERS: Record = { providerId: 'google-sheets', icon: (props) => GoogleSheetsIcon(props), baseProviderIcon: (props) => GoogleIcon(props), - scopes: ['https://www.googleapis.com/auth/drive.file'], + scopes: [ + 'https://www.googleapis.com/auth/drive.file', + 'https://www.googleapis.com/auth/drive', + ], scopeHints: ['sheets'], }, 'google-forms': {