Skip to content

Commit fa4b34f

Browse files
authored
removed broken scope (#2098)
1 parent 9fad586 commit fa4b34f

File tree

6 files changed

+11
-48
lines changed

6 files changed

+11
-48
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const SCOPE_DESCRIPTIONS: Record<string, string> = {
3636
'https://www.googleapis.com/auth/gmail.send': 'Send emails on your behalf',
3737
'https://www.googleapis.com/auth/gmail.labels': 'View and manage your email labels',
3838
'https://www.googleapis.com/auth/gmail.modify': 'View and manage your email messages',
39-
'https://www.googleapis.com/auth/drive.readonly': 'View and read your Google Drive files',
4039
'https://www.googleapis.com/auth/drive.file': 'View and manage your Google Drive files',
4140
'https://www.googleapis.com/auth/calendar': 'View and manage your calendar',
4241
'https://www.googleapis.com/auth/userinfo.email': 'View your email address',

apps/sim/blocks/blocks/google_docs.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
3535
required: true,
3636
provider: 'google-docs',
3737
serviceId: 'google-docs',
38-
requiredScopes: [
39-
'https://www.googleapis.com/auth/drive.readonly',
40-
'https://www.googleapis.com/auth/drive.file',
41-
],
38+
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
4239
placeholder: 'Select Google account',
4340
},
4441
// Document selector (basic mode)

apps/sim/blocks/blocks/google_drive.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
3636
required: true,
3737
provider: 'google-drive',
3838
serviceId: 'google-drive',
39-
requiredScopes: [
40-
'https://www.googleapis.com/auth/drive.readonly',
41-
'https://www.googleapis.com/auth/drive.file',
42-
],
39+
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
4340
placeholder: 'Select Google Drive account',
4441
},
4542
// Create/Upload File Fields
@@ -106,10 +103,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
106103
canonicalParamId: 'folderId',
107104
provider: 'google-drive',
108105
serviceId: 'google-drive',
109-
requiredScopes: [
110-
'https://www.googleapis.com/auth/drive.readonly',
111-
'https://www.googleapis.com/auth/drive.file',
112-
],
106+
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
113107
mimeType: 'application/vnd.google-apps.folder',
114108
placeholder: 'Select a parent folder',
115109
mode: 'basic',
@@ -179,10 +173,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
179173
canonicalParamId: 'folderId',
180174
provider: 'google-drive',
181175
serviceId: 'google-drive',
182-
requiredScopes: [
183-
'https://www.googleapis.com/auth/drive.readonly',
184-
'https://www.googleapis.com/auth/drive.file',
185-
],
176+
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
186177
mimeType: 'application/vnd.google-apps.folder',
187178
placeholder: 'Select a parent folder',
188179
mode: 'basic',
@@ -207,10 +198,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
207198
canonicalParamId: 'folderId',
208199
provider: 'google-drive',
209200
serviceId: 'google-drive',
210-
requiredScopes: [
211-
'https://www.googleapis.com/auth/drive.readonly',
212-
'https://www.googleapis.com/auth/drive.file',
213-
],
201+
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
214202
mimeType: 'application/vnd.google-apps.folder',
215203
placeholder: 'Select a folder to list files from',
216204
mode: 'basic',
@@ -249,10 +237,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
249237
canonicalParamId: 'fileId',
250238
provider: 'google-drive',
251239
serviceId: 'google-drive',
252-
requiredScopes: [
253-
'https://www.googleapis.com/auth/drive.readonly',
254-
'https://www.googleapis.com/auth/drive.file',
255-
],
240+
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
256241
placeholder: 'Select a file to download',
257242
mode: 'basic',
258243
dependsOn: ['credential'],

apps/sim/blocks/blocks/google_sheets.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
3636
required: true,
3737
provider: 'google-sheets',
3838
serviceId: 'google-sheets',
39-
requiredScopes: [
40-
'https://www.googleapis.com/auth/drive.readonly',
41-
'https://www.googleapis.com/auth/drive.file',
42-
],
39+
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
4340
placeholder: 'Select Google account',
4441
},
4542
// Spreadsheet Selector
@@ -50,10 +47,7 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
5047
canonicalParamId: 'spreadsheetId',
5148
provider: 'google-sheets',
5249
serviceId: 'google-sheets',
53-
requiredScopes: [
54-
'https://www.googleapis.com/auth/drive.readonly',
55-
'https://www.googleapis.com/auth/drive.file',
56-
],
50+
requiredScopes: ['https://www.googleapis.com/auth/drive.file'],
5751
mimeType: 'application/vnd.google-apps.spreadsheet',
5852
placeholder: 'Select a spreadsheet',
5953
dependsOn: ['credential'],

apps/sim/lib/auth.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ export const auth = betterAuth({
429429
scopes: [
430430
'https://www.googleapis.com/auth/userinfo.email',
431431
'https://www.googleapis.com/auth/userinfo.profile',
432-
'https://www.googleapis.com/auth/drive.readonly',
433432
'https://www.googleapis.com/auth/drive.file',
434433
],
435434
prompt: 'consent',
@@ -444,7 +443,6 @@ export const auth = betterAuth({
444443
scopes: [
445444
'https://www.googleapis.com/auth/userinfo.email',
446445
'https://www.googleapis.com/auth/userinfo.profile',
447-
'https://www.googleapis.com/auth/drive.readonly',
448446
'https://www.googleapis.com/auth/drive.file',
449447
],
450448
prompt: 'consent',
@@ -459,7 +457,6 @@ export const auth = betterAuth({
459457
scopes: [
460458
'https://www.googleapis.com/auth/userinfo.email',
461459
'https://www.googleapis.com/auth/userinfo.profile',
462-
'https://www.googleapis.com/auth/drive.readonly',
463460
'https://www.googleapis.com/auth/drive.file',
464461
],
465462
prompt: 'consent',

apps/sim/lib/oauth/oauth.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,7 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
140140
providerId: 'google-drive',
141141
icon: (props) => GoogleDriveIcon(props),
142142
baseProviderIcon: (props) => GoogleIcon(props),
143-
scopes: [
144-
'https://www.googleapis.com/auth/drive.readonly',
145-
'https://www.googleapis.com/auth/drive.file',
146-
],
143+
scopes: ['https://www.googleapis.com/auth/drive.file'],
147144
scopeHints: ['drive'],
148145
},
149146
'google-docs': {
@@ -153,10 +150,7 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
153150
providerId: 'google-docs',
154151
icon: (props) => GoogleDocsIcon(props),
155152
baseProviderIcon: (props) => GoogleIcon(props),
156-
scopes: [
157-
'https://www.googleapis.com/auth/drive.readonly',
158-
'https://www.googleapis.com/auth/drive.file',
159-
],
153+
scopes: ['https://www.googleapis.com/auth/drive.file'],
160154
scopeHints: ['docs'],
161155
},
162156
'google-sheets': {
@@ -166,10 +160,7 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
166160
providerId: 'google-sheets',
167161
icon: (props) => GoogleSheetsIcon(props),
168162
baseProviderIcon: (props) => GoogleIcon(props),
169-
scopes: [
170-
'https://www.googleapis.com/auth/drive.readonly',
171-
'https://www.googleapis.com/auth/drive.file',
172-
],
163+
scopes: ['https://www.googleapis.com/auth/drive.file'],
173164
scopeHints: ['sheets'],
174165
},
175166
'google-forms': {

0 commit comments

Comments
 (0)