auth fix
This commit is contained in:
@@ -32,13 +32,7 @@ public class GoogleSheetsHelper
|
||||
if (string.IsNullOrWhiteSpace(json))
|
||||
throw new InvalidOperationException("GOOGLE_SERVICE_ACCOUNT_JSON environment variable is not set.");
|
||||
|
||||
Console.WriteLine($"[GoogleSheetsHelper] Original JSON length: {json.Length}");
|
||||
Console.WriteLine($"[GoogleSheetsHelper] First 200 chars: {json.Substring(0, Math.Min(200, json.Length))}");
|
||||
|
||||
// Replace literal \n with actual newlines
|
||||
json = json.Replace("\\n", "\n");
|
||||
|
||||
Console.WriteLine($"[GoogleSheetsHelper] After replacement, first 200 chars: {json.Substring(0, Math.Min(200, json.Length))}");
|
||||
Console.WriteLine($"[GoogleSheetsHelper] Loading credentials from environment variable (length: {json.Length})");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -46,9 +40,8 @@ public class GoogleSheetsHelper
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[GoogleSheetsHelper] ERROR parsing JSON: {ex.Message}");
|
||||
Console.WriteLine($"[GoogleSheetsHelper] JSON being parsed: {json}");
|
||||
throw;
|
||||
Console.WriteLine($"[GoogleSheetsHelper] ERROR: Failed to parse credentials - {ex.Message}");
|
||||
throw new InvalidOperationException("Failed to parse Google service account credentials. Ensure GOOGLE_SERVICE_ACCOUNT_JSON is properly formatted.", ex);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user