Fixed issue with saving non-persistent tokens

This commit is contained in:
Kenneth Skovhede
2025-08-08 08:27:04 +02:00
parent e3f1aefec2
commit 6b9788b239
@@ -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);