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
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user