auth fix
All checks were successful
Build Docker Images / test (push) Successful in 1m16s
Build Docker Images / build-and-push (push) Successful in 1m36s

This commit is contained in:
2025-11-19 18:30:55 +01:00
parent 62cf71eaa8
commit 3b03c52cd4
2 changed files with 6 additions and 21 deletions

View File

@@ -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
}

View File

@@ -36,17 +36,9 @@ window.initGoogleSignIn = function(clientId) {
window.requestGoogleSignIn = function() {
console.log("🚀 Requesting Google Sign-In...");
// Pokaż One Tap prompt
google.accounts.id.prompt((notification) => {
if (notification.isNotDisplayed()) {
console.warn("⚠️ One Tap not displayed:", notification.getNotDisplayedReason());
} else if (notification.isSkippedMoment()) {
console.warn("⚠️ One Tap skipped:", notification.getSkippedReason());
} else {
console.log("✅ One Tap displayed");
}
});
// Pokaż One Tap prompt (without deprecated notification callbacks for FedCM compatibility)
google.accounts.id.prompt();
};
function handleCredentialResponse(response) {