Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

oauthutil: clear client secret if client ID is set

Michael Terrycd76fd9219ee
diff --git a/lib/oauthutil/oauthutil.go b/lib/oauthutil/oauthutil.go
index 7b0fb9d9d..2f3d5278f 100644
--- a/lib/oauthutil/oauthutil.go
+++ b/lib/oauthutil/oauthutil.go
@@ -376,6 +376,9 @@ func overrideCredentials(name string, m configmap.Mapper, origConfig *oauth2.Con
ClientID, ok := m.Get(config.ConfigClientID)
if ok && ClientID != "" {
newConfig.ClientID = ClientID
+ // Clear out any existing client secret since the ID changed.
+ // (otherwise it's impossible for a config to clear the secret)
+ newConfig.ClientSecret = ""
changed = true
}
ClientSecret, ok := m.Get(config.ConfigClientSecret)