Libation 4.0 prep: do not allow user to change login id in the middle of logging in. If they do then jsonpath will fail
This commit is contained in:
parent
d24c10ddf5
commit
a58f51a8ce
@ -29,10 +29,10 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.passwordLbl = new System.Windows.Forms.Label();
|
this.passwordLbl = new System.Windows.Forms.Label();
|
||||||
this.emailLbl = new System.Windows.Forms.Label();
|
|
||||||
this.passwordTb = new System.Windows.Forms.TextBox();
|
this.passwordTb = new System.Windows.Forms.TextBox();
|
||||||
this.emailTb = new System.Windows.Forms.TextBox();
|
|
||||||
this.submitBtn = new System.Windows.Forms.Button();
|
this.submitBtn = new System.Windows.Forms.Button();
|
||||||
|
this.localeLbl = new System.Windows.Forms.Label();
|
||||||
|
this.usernameLbl = new System.Windows.Forms.Label();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// passwordLbl
|
// passwordLbl
|
||||||
@ -44,15 +44,6 @@
|
|||||||
this.passwordLbl.TabIndex = 2;
|
this.passwordLbl.TabIndex = 2;
|
||||||
this.passwordLbl.Text = "Password";
|
this.passwordLbl.Text = "Password";
|
||||||
//
|
//
|
||||||
// emailLbl
|
|
||||||
//
|
|
||||||
this.emailLbl.AutoSize = true;
|
|
||||||
this.emailLbl.Location = new System.Drawing.Point(12, 15);
|
|
||||||
this.emailLbl.Name = "emailLbl";
|
|
||||||
this.emailLbl.Size = new System.Drawing.Size(32, 13);
|
|
||||||
this.emailLbl.TabIndex = 0;
|
|
||||||
this.emailLbl.Text = "Email";
|
|
||||||
//
|
|
||||||
// passwordTb
|
// passwordTb
|
||||||
//
|
//
|
||||||
this.passwordTb.Location = new System.Drawing.Point(71, 38);
|
this.passwordTb.Location = new System.Drawing.Point(71, 38);
|
||||||
@ -61,13 +52,6 @@
|
|||||||
this.passwordTb.Size = new System.Drawing.Size(200, 20);
|
this.passwordTb.Size = new System.Drawing.Size(200, 20);
|
||||||
this.passwordTb.TabIndex = 3;
|
this.passwordTb.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// emailTb
|
|
||||||
//
|
|
||||||
this.emailTb.Location = new System.Drawing.Point(71, 12);
|
|
||||||
this.emailTb.Name = "emailTb";
|
|
||||||
this.emailTb.Size = new System.Drawing.Size(200, 20);
|
|
||||||
this.emailTb.TabIndex = 1;
|
|
||||||
//
|
|
||||||
// submitBtn
|
// submitBtn
|
||||||
//
|
//
|
||||||
this.submitBtn.Location = new System.Drawing.Point(196, 64);
|
this.submitBtn.Location = new System.Drawing.Point(196, 64);
|
||||||
@ -78,17 +62,35 @@
|
|||||||
this.submitBtn.UseVisualStyleBackColor = true;
|
this.submitBtn.UseVisualStyleBackColor = true;
|
||||||
this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click);
|
this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click);
|
||||||
//
|
//
|
||||||
|
// localeLbl
|
||||||
|
//
|
||||||
|
this.localeLbl.AutoSize = true;
|
||||||
|
this.localeLbl.Location = new System.Drawing.Point(12, 9);
|
||||||
|
this.localeLbl.Name = "localeLbl";
|
||||||
|
this.localeLbl.Size = new System.Drawing.Size(59, 13);
|
||||||
|
this.localeLbl.TabIndex = 0;
|
||||||
|
this.localeLbl.Text = "Locale: {0}";
|
||||||
|
//
|
||||||
|
// usernameLbl
|
||||||
|
//
|
||||||
|
this.usernameLbl.AutoSize = true;
|
||||||
|
this.usernameLbl.Location = new System.Drawing.Point(12, 22);
|
||||||
|
this.usernameLbl.Name = "usernameLbl";
|
||||||
|
this.usernameLbl.Size = new System.Drawing.Size(75, 13);
|
||||||
|
this.usernameLbl.TabIndex = 1;
|
||||||
|
this.usernameLbl.Text = "Username: {0}";
|
||||||
|
//
|
||||||
// AudibleLoginDialog
|
// AudibleLoginDialog
|
||||||
//
|
//
|
||||||
this.AcceptButton = this.submitBtn;
|
this.AcceptButton = this.submitBtn;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(283, 99);
|
this.ClientSize = new System.Drawing.Size(283, 99);
|
||||||
|
this.Controls.Add(this.usernameLbl);
|
||||||
|
this.Controls.Add(this.localeLbl);
|
||||||
this.Controls.Add(this.submitBtn);
|
this.Controls.Add(this.submitBtn);
|
||||||
this.Controls.Add(this.passwordLbl);
|
this.Controls.Add(this.passwordLbl);
|
||||||
this.Controls.Add(this.emailLbl);
|
|
||||||
this.Controls.Add(this.passwordTb);
|
this.Controls.Add(this.passwordTb);
|
||||||
this.Controls.Add(this.emailTb);
|
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||||
this.MaximizeBox = false;
|
this.MaximizeBox = false;
|
||||||
this.MinimizeBox = false;
|
this.MinimizeBox = false;
|
||||||
@ -104,9 +106,9 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Label passwordLbl;
|
private System.Windows.Forms.Label passwordLbl;
|
||||||
private System.Windows.Forms.Label emailLbl;
|
|
||||||
private System.Windows.Forms.TextBox passwordTb;
|
private System.Windows.Forms.TextBox passwordTb;
|
||||||
private System.Windows.Forms.TextBox emailTb;
|
|
||||||
private System.Windows.Forms.Button submitBtn;
|
private System.Windows.Forms.Button submitBtn;
|
||||||
|
private System.Windows.Forms.Label localeLbl;
|
||||||
|
private System.Windows.Forms.Label usernameLbl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,21 +1,32 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using InternalUtilities;
|
||||||
|
|
||||||
namespace LibationWinForms.Dialogs.Login
|
namespace LibationWinForms.Dialogs.Login
|
||||||
{
|
{
|
||||||
public partial class AudibleLoginDialog : Form
|
public partial class AudibleLoginDialog : Form
|
||||||
{
|
{
|
||||||
|
private string locale { get; }
|
||||||
|
private string accountId { get; }
|
||||||
|
|
||||||
public string Email { get; private set; }
|
public string Email { get; private set; }
|
||||||
public string Password { get; private set; }
|
public string Password { get; private set; }
|
||||||
|
|
||||||
public AudibleLoginDialog()
|
public AudibleLoginDialog(Account account)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
locale = account.Locale.Name;
|
||||||
|
accountId = account.AccountId;
|
||||||
|
|
||||||
|
// do not allow user to change login id here. if they do then jsonpath will fail
|
||||||
|
this.localeLbl.Text = string.Format(this.localeLbl.Text, locale);
|
||||||
|
this.usernameLbl.Text = string.Format(this.usernameLbl.Text, accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void submitBtn_Click(object sender, EventArgs e)
|
private void submitBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Email = this.emailTb.Text;
|
Email = accountId;
|
||||||
Password = this.passwordTb.Text;
|
Password = this.passwordTb.Text;
|
||||||
|
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ namespace LibationWinForms.Login
|
|||||||
|
|
||||||
public (string email, string password) GetLogin()
|
public (string email, string password) GetLogin()
|
||||||
{
|
{
|
||||||
using var dialog = new AudibleLoginDialog();
|
using var dialog = new AudibleLoginDialog(_account);
|
||||||
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||||
return (dialog.Email, dialog.Password);
|
return (dialog.Email, dialog.Password);
|
||||||
return (null, null);
|
return (null, null);
|
||||||
|
|||||||
@ -29,10 +29,10 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.passwordLbl = new System.Windows.Forms.Label();
|
this.passwordLbl = new System.Windows.Forms.Label();
|
||||||
this.emailLbl = new System.Windows.Forms.Label();
|
|
||||||
this.passwordTb = new System.Windows.Forms.TextBox();
|
this.passwordTb = new System.Windows.Forms.TextBox();
|
||||||
this.emailTb = new System.Windows.Forms.TextBox();
|
|
||||||
this.submitBtn = new System.Windows.Forms.Button();
|
this.submitBtn = new System.Windows.Forms.Button();
|
||||||
|
this.localeLbl = new System.Windows.Forms.Label();
|
||||||
|
this.usernameLbl = new System.Windows.Forms.Label();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// passwordLbl
|
// passwordLbl
|
||||||
@ -44,15 +44,6 @@
|
|||||||
this.passwordLbl.TabIndex = 2;
|
this.passwordLbl.TabIndex = 2;
|
||||||
this.passwordLbl.Text = "Password";
|
this.passwordLbl.Text = "Password";
|
||||||
//
|
//
|
||||||
// emailLbl
|
|
||||||
//
|
|
||||||
this.emailLbl.AutoSize = true;
|
|
||||||
this.emailLbl.Location = new System.Drawing.Point(12, 15);
|
|
||||||
this.emailLbl.Name = "emailLbl";
|
|
||||||
this.emailLbl.Size = new System.Drawing.Size(32, 13);
|
|
||||||
this.emailLbl.TabIndex = 0;
|
|
||||||
this.emailLbl.Text = "Email";
|
|
||||||
//
|
|
||||||
// passwordTb
|
// passwordTb
|
||||||
//
|
//
|
||||||
this.passwordTb.Location = new System.Drawing.Point(71, 38);
|
this.passwordTb.Location = new System.Drawing.Point(71, 38);
|
||||||
@ -61,13 +52,6 @@
|
|||||||
this.passwordTb.Size = new System.Drawing.Size(200, 20);
|
this.passwordTb.Size = new System.Drawing.Size(200, 20);
|
||||||
this.passwordTb.TabIndex = 3;
|
this.passwordTb.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// emailTb
|
|
||||||
//
|
|
||||||
this.emailTb.Location = new System.Drawing.Point(71, 12);
|
|
||||||
this.emailTb.Name = "emailTb";
|
|
||||||
this.emailTb.Size = new System.Drawing.Size(200, 20);
|
|
||||||
this.emailTb.TabIndex = 1;
|
|
||||||
//
|
|
||||||
// submitBtn
|
// submitBtn
|
||||||
//
|
//
|
||||||
this.submitBtn.Location = new System.Drawing.Point(196, 64);
|
this.submitBtn.Location = new System.Drawing.Point(196, 64);
|
||||||
@ -77,17 +61,35 @@
|
|||||||
this.submitBtn.Text = "Submit";
|
this.submitBtn.Text = "Submit";
|
||||||
this.submitBtn.UseVisualStyleBackColor = true;
|
this.submitBtn.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// localeLbl
|
||||||
|
//
|
||||||
|
this.localeLbl.AutoSize = true;
|
||||||
|
this.localeLbl.Location = new System.Drawing.Point(12, 9);
|
||||||
|
this.localeLbl.Name = "localeLbl";
|
||||||
|
this.localeLbl.Size = new System.Drawing.Size(59, 13);
|
||||||
|
this.localeLbl.TabIndex = 0;
|
||||||
|
this.localeLbl.Text = "Locale: {0}";
|
||||||
|
//
|
||||||
|
// usernameLbl
|
||||||
|
//
|
||||||
|
this.usernameLbl.AutoSize = true;
|
||||||
|
this.usernameLbl.Location = new System.Drawing.Point(12, 22);
|
||||||
|
this.usernameLbl.Name = "usernameLbl";
|
||||||
|
this.usernameLbl.Size = new System.Drawing.Size(75, 13);
|
||||||
|
this.usernameLbl.TabIndex = 1;
|
||||||
|
this.usernameLbl.Text = "Username: {0}";
|
||||||
|
//
|
||||||
// AudibleLoginDialog
|
// AudibleLoginDialog
|
||||||
//
|
//
|
||||||
this.AcceptButton = this.submitBtn;
|
this.AcceptButton = this.submitBtn;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(283, 99);
|
this.ClientSize = new System.Drawing.Size(283, 99);
|
||||||
|
this.Controls.Add(this.usernameLbl);
|
||||||
|
this.Controls.Add(this.localeLbl);
|
||||||
this.Controls.Add(this.submitBtn);
|
this.Controls.Add(this.submitBtn);
|
||||||
this.Controls.Add(this.passwordLbl);
|
this.Controls.Add(this.passwordLbl);
|
||||||
this.Controls.Add(this.emailLbl);
|
|
||||||
this.Controls.Add(this.passwordTb);
|
this.Controls.Add(this.passwordTb);
|
||||||
this.Controls.Add(this.emailTb);
|
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||||
this.MaximizeBox = false;
|
this.MaximizeBox = false;
|
||||||
this.MinimizeBox = false;
|
this.MinimizeBox = false;
|
||||||
@ -103,9 +105,9 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Label passwordLbl;
|
private System.Windows.Forms.Label passwordLbl;
|
||||||
private System.Windows.Forms.Label emailLbl;
|
|
||||||
private System.Windows.Forms.TextBox passwordTb;
|
private System.Windows.Forms.TextBox passwordTb;
|
||||||
private System.Windows.Forms.TextBox emailTb;
|
|
||||||
private System.Windows.Forms.Button submitBtn;
|
private System.Windows.Forms.Button submitBtn;
|
||||||
|
private System.Windows.Forms.Label localeLbl;
|
||||||
|
private System.Windows.Forms.Label usernameLbl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user