From ad84f24b261473ed3726b424461574ca94fa8677 Mon Sep 17 00:00:00 2001 From: Paolo TUNAY <13820135+ptunay@users.noreply.github.com> Date: Wed, 15 Jun 2022 16:39:47 +0800 Subject: [PATCH] remove defaultScope from customScope For cases when we don't need the 'https://www.googleapis.com/auth/drive.readonly' scope and supply our own customScope --- src/index.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index a719373..a94feb5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -69,10 +69,9 @@ export default function useDrivePicker(): [ if (!config.token) { const client = google.accounts.oauth2.initTokenClient({ client_id: config.clientId, - scope: (config.customScopes - ? [...defaultScopes, ...config.customScopes] - : defaultScopes - ).join(' '), + scope: (config.customScopes ? config.customScopes : defaultScopes).join( + ' ' + ), callback: (tokenResponse: authResult) => { setAuthRes(tokenResponse) createPicker({ ...config, token: tokenResponse.access_token })