From 5146b66569dd0eb2b44fe75972f8227e4bc3e397 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Thu, 25 Sep 2025 23:10:44 +0200 Subject: [PATCH] jottacloud: fix legacy authentication This fixes the issue where configuration would fail after supplying passoword: Reveal failed: input too short when revealing password - is it obscured? --- backend/jottacloud/jottacloud.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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