From d4fbb035774672c06b3eed7249254e8cf10612d6 Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Thu, 29 Jul 2021 07:39:14 -0400 Subject: [PATCH] Login debugging --- .../Dialogs/Login/ApprovalNeededDialog.cs | 2 ++ .../Dialogs/Login/AudibleLoginDialog.cs | 3 +++ LibationWinForms/Dialogs/Login/CaptchaDialog.cs | 2 ++ LibationWinForms/Dialogs/Login/MfaDialog.cs | 17 ++++++++++------- .../Dialogs/Login/_2faCodeDialog.cs | 3 +++ 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/LibationWinForms/Dialogs/Login/ApprovalNeededDialog.cs b/LibationWinForms/Dialogs/Login/ApprovalNeededDialog.cs index d555d077..0d08e58b 100644 --- a/LibationWinForms/Dialogs/Login/ApprovalNeededDialog.cs +++ b/LibationWinForms/Dialogs/Login/ApprovalNeededDialog.cs @@ -12,6 +12,8 @@ namespace LibationWinForms.Dialogs.Login private void approvedBtn_Click(object sender, EventArgs e) { + Serilog.Log.Logger.Information("Submit button clicked"); + DialogResult = DialogResult.OK; } } diff --git a/LibationWinForms/Dialogs/Login/AudibleLoginDialog.cs b/LibationWinForms/Dialogs/Login/AudibleLoginDialog.cs index 8ff425c9..426bae71 100644 --- a/LibationWinForms/Dialogs/Login/AudibleLoginDialog.cs +++ b/LibationWinForms/Dialogs/Login/AudibleLoginDialog.cs @@ -1,5 +1,6 @@ using System; using System.Windows.Forms; +using Dinah.Core; using InternalUtilities; namespace LibationWinForms.Dialogs.Login @@ -29,6 +30,8 @@ namespace LibationWinForms.Dialogs.Login Email = accountId; Password = this.passwordTb.Text; + Serilog.Log.Logger.Information("Submit button clicked: {@DebugInfo}", new { email = Email?.ToMask(), passwordLength = Password.Length }); + DialogResult = DialogResult.OK; // Close() not needed for AcceptButton } diff --git a/LibationWinForms/Dialogs/Login/CaptchaDialog.cs b/LibationWinForms/Dialogs/Login/CaptchaDialog.cs index bc6a6965..e9b3becb 100644 --- a/LibationWinForms/Dialogs/Login/CaptchaDialog.cs +++ b/LibationWinForms/Dialogs/Login/CaptchaDialog.cs @@ -26,6 +26,8 @@ namespace LibationWinForms.Dialogs.Login { Answer = this.answerTb.Text; + Serilog.Log.Logger.Information("Submit button clicked: {@DebugInfo}", new { Answer }); + DialogResult = DialogResult.OK; // Close() not needed for AcceptButton } diff --git a/LibationWinForms/Dialogs/Login/MfaDialog.cs b/LibationWinForms/Dialogs/Login/MfaDialog.cs index bf074692..add77588 100644 --- a/LibationWinForms/Dialogs/Login/MfaDialog.cs +++ b/LibationWinForms/Dialogs/Login/MfaDialog.cs @@ -63,26 +63,29 @@ namespace LibationWinForms.Dialogs.Login public string SelectedValue { get; private set; } private void submitBtn_Click(object sender, EventArgs e) { - Serilog.Log.Logger.Information("RadioButton states: {@DebugInfo}", new { + var selected = radioButtons.FirstOrDefault(rb => rb.Checked); + + Serilog.Log.Logger.Information("Submit button clicked: {@DebugInfo}", new { rb1_visible = radioButton1.Visible, rb1_checked = radioButton1.Checked, - r21_visible = radioButton2.Visible, - r21_checked = radioButton2.Checked, + rb2_visible = radioButton2.Visible, + rb2_checked = radioButton2.Checked, rb3_visible = radioButton3.Visible, - rb3_checked = radioButton3.Checked + rb3_checked = radioButton3.Checked, + + isSelected = selected is not null, + name = selected?.Name, + value = selected?.Tag }); - var selected = radioButtons.FirstOrDefault(rb => rb.Checked); if (selected is null) { MessageBox.Show("No MFA option selected", "None selected", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - Serilog.Log.Logger.Information("Selected: {@DebugInfo}", new { isSelected = selected is not null, name = selected?.Name, value = selected?.Tag }); - SelectedName = selected.Name; SelectedValue = (string)selected.Tag; diff --git a/LibationWinForms/Dialogs/Login/_2faCodeDialog.cs b/LibationWinForms/Dialogs/Login/_2faCodeDialog.cs index a223348f..39cd797c 100644 --- a/LibationWinForms/Dialogs/Login/_2faCodeDialog.cs +++ b/LibationWinForms/Dialogs/Login/_2faCodeDialog.cs @@ -15,6 +15,9 @@ namespace LibationWinForms.Dialogs.Login private void submitBtn_Click(object sender, EventArgs e) { Code = this.codeTb.Text; + + Serilog.Log.Logger.Information("Submit button clicked: {@DebugInfo}", new { Code }); + DialogResult = DialogResult.OK; } }