From 2208e218cf2238ebfe8b7e24f51fb2fb8b18d516 Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Fri, 26 May 2023 19:11:32 +0700 Subject: [PATCH] Revert: gdrive client --- src/utils/apiHelper/gdrive.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/utils/apiHelper/gdrive.ts b/src/utils/apiHelper/gdrive.ts index 09e9762..dd26b89 100644 --- a/src/utils/apiHelper/gdrive.ts +++ b/src/utils/apiHelper/gdrive.ts @@ -27,15 +27,11 @@ const oauth2Client = new google.auth.OAuth2({ eagerRefreshThresholdMillis: 10000, redirectUri: "http://localhost", }); -function initializeClient() { - oauth2Client.setCredentials({ - refresh_token: config.refresh_token as string, - }); - gdrive = google.drive({ - version: "v3", - auth: oauth2Client, - }); -} - -initializeClient(); +oauth2Client.setCredentials({ + refresh_token: config.refresh_token as string, +}); +gdrive = google.drive({ + version: "v3", + auth: oauth2Client, +}); export default gdrive;