From 9c3bcbabf9ea3aebcbc1e36cd7d261c129644228 Mon Sep 17 00:00:00 2001 From: Adam Gough <77861281+aadamgough@users.noreply.github.com> Date: Sat, 2 Aug 2025 14:59:46 -0700 Subject: [PATCH] fix(google-scopes): removed unnecessary google scopes (#849) * removed unnecessary google scopes * bun run lint #849 --------- Co-authored-by: Adam Gough --- .../credential-selector/components/oauth-required-modal.tsx | 1 - apps/sim/blocks/blocks/google_sheets.ts | 2 +- apps/sim/lib/auth.ts | 1 - apps/sim/lib/oauth/oauth.ts | 5 +---- apps/sim/tools/gmail/draft.ts | 2 +- apps/sim/tools/google_sheets/append.ts | 2 +- apps/sim/tools/google_sheets/read.ts | 2 +- apps/sim/tools/google_sheets/update.ts | 2 +- apps/sim/tools/google_sheets/write.ts | 2 +- 9 files changed, 7 insertions(+), 12 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx index b30ad1abb5..eb9df9cb67 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx @@ -43,7 +43,6 @@ const SCOPE_DESCRIPTIONS: Record = { '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', - 'https://www.googleapis.com/auth/spreadsheets': 'View and manage your Google Sheets', 'read:page:confluence': 'Read Confluence pages', 'write:page:confluence': 'Write Confluence pages', 'read:me': 'Read your profile information', diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index c23237024e..77d106df21 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -36,7 +36,7 @@ export const GoogleSheetsBlock: BlockConfig = { required: true, provider: 'google-sheets', serviceId: 'google-sheets', - requiredScopes: ['https://www.googleapis.com/auth/spreadsheets'], + requiredScopes: [], placeholder: 'Select Google account', }, // Spreadsheet Selector diff --git a/apps/sim/lib/auth.ts b/apps/sim/lib/auth.ts index 475ef2bd42..20ffbeb2dc 100644 --- a/apps/sim/lib/auth.ts +++ b/apps/sim/lib/auth.ts @@ -388,7 +388,6 @@ export const auth = betterAuth({ scopes: [ 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', - 'https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive.file', ], prompt: 'consent', diff --git a/apps/sim/lib/oauth/oauth.ts b/apps/sim/lib/oauth/oauth.ts index e8b7bb9c20..8b538c7e87 100644 --- a/apps/sim/lib/oauth/oauth.ts +++ b/apps/sim/lib/oauth/oauth.ts @@ -131,10 +131,7 @@ export const OAUTH_PROVIDERS: Record = { providerId: 'google-sheets', icon: (props) => GoogleSheetsIcon(props), baseProviderIcon: (props) => GoogleIcon(props), - scopes: [ - 'https://www.googleapis.com/auth/spreadsheets', - 'https://www.googleapis.com/auth/drive.file', - ], + scopes: ['https://www.googleapis.com/auth/drive.file'], }, 'google-calendar': { id: 'google-calendar', diff --git a/apps/sim/tools/gmail/draft.ts b/apps/sim/tools/gmail/draft.ts index 70c8bd0531..ec8455a435 100644 --- a/apps/sim/tools/gmail/draft.ts +++ b/apps/sim/tools/gmail/draft.ts @@ -12,7 +12,7 @@ export const gmailDraftTool: ToolConfig = { oauth: { required: true, provider: 'google-email', - additionalScopes: ['https://www.googleapis.com/auth/gmail.compose'], + additionalScopes: [], }, params: { diff --git a/apps/sim/tools/google_sheets/append.ts b/apps/sim/tools/google_sheets/append.ts index 3a962d340c..dbd92860cf 100644 --- a/apps/sim/tools/google_sheets/append.ts +++ b/apps/sim/tools/google_sheets/append.ts @@ -12,7 +12,7 @@ export const appendTool: ToolConfig