From 6b9788b2390faa24a1e2fe1a5ed4bd15dc2ea8d3 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Fri, 8 Aug 2025 08:27:04 +0200 Subject: [PATCH] Fixed issue with saving non-persistent tokens --- Duplicati/CommandLine/ServerUtil/Connection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Duplicati/CommandLine/ServerUtil/Connection.cs b/Duplicati/CommandLine/ServerUtil/Connection.cs index 720a1d94f..d98eaf421 100644 --- a/Duplicati/CommandLine/ServerUtil/Connection.cs +++ b/Duplicati/CommandLine/ServerUtil/Connection.cs @@ -227,7 +227,7 @@ public class Connection if (string.IsNullOrWhiteSpace(accessToken)) throw new InvalidOperationException("Failed to get access token"); - if (!string.IsNullOrWhiteSpace(refreshToken)) + if (!string.IsNullOrWhiteSpace(refreshToken) && obtainRefreshToken) (settings with { RefreshToken = refreshToken, RefreshNonce = refreshNonce }).Save(console); return CreateConnectionWithClient(client, accessToken); @@ -264,7 +264,7 @@ public class Connection if (string.IsNullOrWhiteSpace(accessToken)) throw new InvalidOperationException("Failed to get access token"); - if (!string.IsNullOrWhiteSpace(refreshToken)) + if (!string.IsNullOrWhiteSpace(refreshToken) && obtainRefreshToken) (settings with { RefreshToken = refreshToken, RefreshNonce = refreshNonce }).Save(console); return CreateConnectionWithClient(client, accessToken);