From 27c9c7375b329765718c363562a272a75ecea39c Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Wed, 4 Dec 2024 17:18:16 +0800 Subject: [PATCH] Google picker scope (#5535) * fix scope * set default view type list --- .../@uppy/provider-views/src/GooglePicker/googlePicker.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts b/packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts index 53fcaf9069..4f324c3d72 100644 --- a/packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts +++ b/packages/@uppy/provider-views/src/GooglePicker/googlePicker.ts @@ -154,7 +154,7 @@ export async function authorize({ (resolve, reject) => { const scopes = pickerType === 'drive' ? - ['https://www.googleapis.com/auth/drive.readonly'] + ['https://www.googleapis.com/auth/drive.file'] : ['https://www.googleapis.com/auth/photospicker.mediaitems.readonly'] const tokenClient = google.accounts.oauth2.initTokenClient({ @@ -240,7 +240,8 @@ export async function showDrivePicker({ .setIncludeFolders(true) // Note: setEnableDrives doesn't seem to work // .setEnableDrives(true) - .setSelectFolderEnabled(false), + .setSelectFolderEnabled(false) + .setMode(google.picker.DocsViewMode.LIST), ) // NOTE: photos is broken and results in an error being returned from Google // I think it's the old Picasa photos