From 4abbf1162db72f205213a3fbad3cd8424f1e70df Mon Sep 17 00:00:00 2001 From: sim0n00ps Date: Mon, 5 May 2025 21:40:06 +0100 Subject: [PATCH] Tweak for #1 --- OF DL/Program.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/OF DL/Program.cs b/OF DL/Program.cs index ab1326b..f6900c9 100644 --- a/OF DL/Program.cs +++ b/OF DL/Program.cs @@ -533,9 +533,12 @@ public class Program catch (Exception _) { Log.Information("Auth file found but could not be deserialized"); - Log.Debug("Deleting auth.json"); - File.Delete("auth.json"); - + if (!config!.DisableBrowserAuth) + { + Log.Debug("Deleting auth.json"); + File.Delete("auth.json"); + } + if (cliNonInteractive) { AnsiConsole.MarkupLine($"\n[red]auth.json has invalid JSON syntax. The file can be generated automatically when OF-DL is run in the standard, interactive mode.[/]\n"); @@ -744,10 +747,13 @@ public class Program Log.Error("Auth failed"); auth = null; - if (File.Exists("auth.json")) - { - File.Delete("auth.json"); - } + if (!config!.DisableBrowserAuth) + { + if (File.Exists("auth.json")) + { + File.Delete("auth.json"); + } + } if (!cliNonInteractive && !config!.DisableBrowserAuth) {