From a3a80f5ea42fcf8b08766bad738af4d581819809 Mon Sep 17 00:00:00 2001 From: Donkey Date: Mon, 29 Jul 2024 22:31:12 +0200 Subject: [PATCH] fix: dialog for login doesn't close for NuGet servers if login fails, this closes #136 (cherry picked from commit bc214ae5011f027720aff87381acaa32add38648) --- TwinpackShared/Protocol/Authentication.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/TwinpackShared/Protocol/Authentication.cs b/TwinpackShared/Protocol/Authentication.cs index 7145bb3..6e794bb 100644 --- a/TwinpackShared/Protocol/Authentication.cs +++ b/TwinpackShared/Protocol/Authentication.cs @@ -74,20 +74,24 @@ public async Task LoginAsync(bool onlyTry = false, CancellationToken cancellatio } catch (Exception ex) { - message = "Login to Twinpack Server failed!"; + message = $@"Login to Twinpack Server failed, see '%LOCALAPPDATA%\Zeugwerk\logs\Twinpack' for details!"; _logger.Trace(ex); _logger.Error(ex.Message); } - if (!_packageServer.LoggedIn && _packageServer.UrlRegister != null) + if (!_packageServer.LoggedIn) { - if (MessageBox.Show($@"{message} Do you want to register?", "Login failed", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) + if (_packageServer.UrlRegister != null) { - Process.Start(_packageServer.UrlRegister); + if (MessageBox.Show($"{message}\n\nDo you need to register?", "Login failed", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) + Process.Start(_packageServer.UrlRegister); + else + return; } else { - return; + if (MessageBox.Show($"{message}\n\nRetry?", "Login failed", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No) + return; } } }