From ea60669a8aceeebde81b121533dfac39ad24649f Mon Sep 17 00:00:00 2001 From: Will Vedder Date: Wed, 22 Nov 2023 09:28:19 -0500 Subject: [PATCH] Prevent access token writen to config file if stored in keyring (#919) Fixing error check Co-authored-by: Will Vedder --- internal/config/tenant.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/config/tenant.go b/internal/config/tenant.go index 1e30fe4c1..fa00cf49c 100644 --- a/internal/config/tenant.go +++ b/internal/config/tenant.go @@ -151,7 +151,7 @@ func (t *Tenant) RegenerateAccessToken(ctx context.Context) error { t.ExpiresAt = time.Now().Add(time.Duration(tokenResponse.ExpiresIn) * time.Second) } - if err := keyring.StoreAccessToken(t.Domain, t.AccessToken); err != nil { + if err := keyring.StoreAccessToken(t.Domain, t.AccessToken); err == nil { t.AccessToken = "" }