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

jottacloud: fix legacy authentication

albertony5146b66569dd
diff --git a/backend/jottacloud/jottacloud.go b/backend/jottacloud/jottacloud.go
index f074ceea2..81686d517 100644
--- a/backend/jottacloud/jottacloud.go
+++ b/backend/jottacloud/jottacloud.go
@@ -242,12 +242,12 @@ machines.`)
authCode, _ := m.Get("auth_code")
srv := rest.NewClient(fshttp.NewClient(ctx))
- clientID, ok := m.Get(configClientID)
- if !ok {
+ clientID, _ := m.Get(configClientID)
+ if clientID == "" {
clientID = legacyClientID
}
- clientSecret, ok := m.Get(configClientSecret)
- if !ok {
+ clientSecret, _ := m.Get(configClientSecret)
+ if clientSecret == "" {
clientSecret = legacyEncryptedClientSecret
}
@@ -929,12 +929,12 @@ func getOAuthClient(ctx context.Context, name string, m configmap.Mapper) (oAuth
oauthConfig.AuthURL = tokenURL
}
} else if ver == legacyConfigVersion {
- clientID, ok := m.Get(configClientID)
- if !ok {
+ clientID, _ := m.Get(configClientID)
+ if clientID == "" {
clientID = legacyClientID
}
- clientSecret, ok := m.Get(configClientSecret)
- if !ok {
+ clientSecret, _ := m.Get(configClientSecret)
+ if clientSecret == "" {
clientSecret = legacyEncryptedClientSecret
}
oauthConfig.ClientID = clientID