From 42fb04e363f49f34f0cae6935084aebfba13109f Mon Sep 17 00:00:00 2001 From: Brian Graves Date: Fri, 19 Sep 2025 13:56:38 -0700 Subject: [PATCH] Add log lines to google_drive.js (#691) * Adds log lines to google_drive.js * fix string issue --- lib/actions/google/drive/google_drive.js | 4 ++++ src/actions/google/drive/google_drive.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/actions/google/drive/google_drive.js b/lib/actions/google/drive/google_drive.js index 1e839ff3..cf0a021c 100644 --- a/lib/actions/google/drive/google_drive.js +++ b/lib/actions/google/drive/google_drive.js @@ -227,6 +227,7 @@ class GoogleDriveAction extends Hub.OAuthActionV2 { const statePayload = JSON.parse(plaintext); if (statePayload.hasOwnProperty("tokenurl")) { // redirect user back to Looker with context + winston.info("Redirected with V2 flow"); const newState = { code: urlParams.code, redirecturi: redirectUri, @@ -240,7 +241,9 @@ class GoogleDriveAction extends Hub.OAuthActionV2 { } else { // Pass back context to Looker + winston.info("Posting1 to " + statePayload.stateurl); const tokens = await this.getAccessTokenCredentialsFromCode(redirectUri, urlParams.code); + winston.info("Posting2 to " + statePayload.stateurl); await https.post({ url: statePayload.stateurl, body: JSON.stringify({ tokens, redirect: redirectUri }), @@ -421,6 +424,7 @@ class GoogleDriveAction extends Hub.OAuthActionV2 { const form = new Hub.ActionForm(); form.fields = []; const hasTokenUrl = request.params.hasOwnProperty("state_redir_url"); + winston.info(`Using ${hasTokenUrl ? "V2" : "V1"} flow`); const state = hasTokenUrl ? { tokenurl: request.params.state_redir_url } : { stateurl: request.params.state_url }; const jsonString = JSON.stringify(state); const actionCrypto = new Hub.ActionCrypto(); diff --git a/src/actions/google/drive/google_drive.ts b/src/actions/google/drive/google_drive.ts index aa869f04..385b6c86 100644 --- a/src/actions/google/drive/google_drive.ts +++ b/src/actions/google/drive/google_drive.ts @@ -485,7 +485,7 @@ export class GoogleDriveAction extends Hub.OAuthActionV2 { form.fields = [] const hasTokenUrl = request.params.hasOwnProperty("state_redir_url") - winston.info("Using" + hasTokenUrl ? "V2" : "V1") + winston.info(`Using ${hasTokenUrl ? "V2" : "V1"} flow`) const state = hasTokenUrl ? {tokenurl: request.params.state_redir_url} : {stateurl: request.params.state_url} const jsonString = JSON.stringify(state)