This commit is contained in:
2022-06-20 22:27:33 +00:00
parent 0e7d1de1ed
commit 7ced9e377c
2 changed files with 31 additions and 25 deletions

View File

@@ -12,7 +12,7 @@ namespace AyaNovaQBI
{
public partial class tfa : Form
{
public string TFACode { get; set; }
public string TFAPin { get; set; }
public tfa()
{
InitializeComponent();
@@ -24,18 +24,15 @@ namespace AyaNovaQBI
}
private async void btnVerifyCode_click(object sender, EventArgs e)
private void btnVerifyCode_click(object sender, EventArgs e)
{
var res = await util.AuthenticateTFAAsync(ed);
if (!res)
TFAPin = edTFACode.Text;
if (string.IsNullOrWhiteSpace(TFAPin))
{
MessageBox.Show("Login failed");
btnLogin.Enabled = btnTest.Enabled = true;
this.DialogResult = DialogResult.Cancel;
MessageBox.Show("TFA Code is required to log in");
return;
}
this.DialogResult = DialogResult.OK;
this.Close();
}