From 5944bb7d38eb2ee75e7536183663eca3942de737 Mon Sep 17 00:00:00 2001 From: Brian Graves Date: Thu, 18 Sep 2025 15:17:39 -0700 Subject: [PATCH] Add more logging to oauth flow (#690) --- src/actions/google/drive/google_drive.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/actions/google/drive/google_drive.ts b/src/actions/google/drive/google_drive.ts index 1f2d72fe..aa869f04 100644 --- a/src/actions/google/drive/google_drive.ts +++ b/src/actions/google/drive/google_drive.ts @@ -267,6 +267,7 @@ export 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, @@ -280,7 +281,9 @@ export class GoogleDriveAction extends Hub.OAuthActionV2 { return `${statePayload.tokenurl}?state=${ciphertextBlob}` } 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}), @@ -482,6 +485,7 @@ export class GoogleDriveAction extends Hub.OAuthActionV2 { form.fields = [] const hasTokenUrl = request.params.hasOwnProperty("state_redir_url") + winston.info("Using" + hasTokenUrl ? "V2" : "V1") const state = hasTokenUrl ? {tokenurl: request.params.state_redir_url} : {stateurl: request.params.state_url} const jsonString = JSON.stringify(state)