From 566782fa82c7d6fb2bb00a24b0412b84cbd8001f Mon Sep 17 00:00:00 2001 From: R0m1k3 Date: Wed, 21 Jan 2026 16:09:21 +0100 Subject: [PATCH] chore(debug): add verbose logging for analytics token validation --- server/services/analytics.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/services/analytics.ts b/server/services/analytics.ts index 8fed326..20eb874 100644 --- a/server/services/analytics.ts +++ b/server/services/analytics.ts @@ -168,6 +168,11 @@ export class AnalyticsService { } catch (error: any) { console.error(`[AnalyticsService] Failed to fetch basic info for ${pageId}:`, error); + // DEBUG: Log key details to diagnose token issues + const tokenPreview = accessToken ? `${accessToken.substring(0, 10)}...` : 'undefined'; + console.log(`[AnalyticsService] DEBUG: Token used: ${tokenPreview}`); + console.log(`[AnalyticsService] DEBUG: Full Error Object:`, JSON.stringify(error, null, 2)); + // Check if it's an Auth Error (Token invalid/expired) // Codes: 190 (Invalid OAuth), 102 (API Session), 10 (Permission), 463 (Expired), 467 (Invalid) if (error.code === 190 || error.code === 463 || error.code === 467) {