From bed3753bad970327ed3839fb1b2cda1a234060dd Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Sun, 18 Jan 2026 17:34:00 +1000
Subject: [PATCH] Update OAuth credentials patch for 145

Google doesn't let us bake in OAuth2 credentials, and for some time,
Google sign-in has been broken. Arch dealt with this in March, and so
did we to some degree, but in the last few months, our sign-in
credentials have been broken. It appears that we actually did remove API
credentials in March around Chrome 89, but they got added back, perhaps
when rotating newer versions to replace older versions. Work around this
by following Arch's lead: we remove the predefined credentials, as
before, but also we patch Chromium so that people can use their own
easily, using Arch's patch for that.

Signed-off-by: Matt Jolly <kangie@gentoo.org>
--- a/google_apis/api_key_cache.cc
+++ b/google_apis/api_key_cache.cc
@@ -235,14 +235,14 @@ ApiKeyCache::ApiKeyCache(const DefaultApiKeys& default_api_keys) {
 
   std::string default_client_id = CalculateKeyValue(
       default_api_keys.google_default_client_id,
-      STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), std::string(), nullptr,
+      STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), std::string(), ::switches::kOAuth2ClientID,
       std::string(), environment.get(), command_line, gaia_config,
       default_api_keys.allow_override_via_environment,
       default_api_keys.allow_unset_values);
   std::string default_client_secret = CalculateKeyValue(
       default_api_keys.google_default_client_secret,
       STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), std::string(),
-      nullptr, std::string(), environment.get(), command_line, gaia_config,
+      ::switches::kOAuth2ClientSecret, std::string(), environment.get(), command_line, gaia_config,
       default_api_keys.allow_override_via_environment,
       default_api_keys.allow_unset_values);
 
-- 
2.52.0
