auth fix
This commit is contained in:
@@ -32,13 +32,7 @@ public class GoogleSheetsHelper
|
|||||||
if (string.IsNullOrWhiteSpace(json))
|
if (string.IsNullOrWhiteSpace(json))
|
||||||
throw new InvalidOperationException("GOOGLE_SERVICE_ACCOUNT_JSON environment variable is not set.");
|
throw new InvalidOperationException("GOOGLE_SERVICE_ACCOUNT_JSON environment variable is not set.");
|
||||||
|
|
||||||
Console.WriteLine($"[GoogleSheetsHelper] Original JSON length: {json.Length}");
|
Console.WriteLine($"[GoogleSheetsHelper] Loading credentials from environment variable (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))}");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -46,9 +40,8 @@ public class GoogleSheetsHelper
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"[GoogleSheetsHelper] ERROR parsing JSON: {ex.Message}");
|
Console.WriteLine($"[GoogleSheetsHelper] ERROR: Failed to parse credentials - {ex.Message}");
|
||||||
Console.WriteLine($"[GoogleSheetsHelper] JSON being parsed: {json}");
|
throw new InvalidOperationException("Failed to parse Google service account credentials. Ensure GOOGLE_SERVICE_ACCOUNT_JSON is properly formatted.", ex);
|
||||||
throw;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,16 +37,8 @@ window.initGoogleSignIn = function(clientId) {
|
|||||||
window.requestGoogleSignIn = function() {
|
window.requestGoogleSignIn = function() {
|
||||||
console.log("🚀 Requesting Google Sign-In...");
|
console.log("🚀 Requesting Google Sign-In...");
|
||||||
|
|
||||||
// Pokaż One Tap prompt
|
// Pokaż One Tap prompt (without deprecated notification callbacks for FedCM compatibility)
|
||||||
google.accounts.id.prompt((notification) => {
|
google.accounts.id.prompt();
|
||||||
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");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleCredentialResponse(response) {
|
function handleCredentialResponse(response) {
|
||||||
|
|||||||
Reference in New Issue
Block a user