private async void Loginbutton_Click(object sender, EventArgs e) { var username = UsernameTextbox.Text; var pass = PasswordTextbox.Text; var request = AuthenticatorService.GetCredentials(UsernameTextbox.Text, PasswordTextbox.Text); var result = await AuthenticatorService.Service.AuthenticateUserAsync(request); if (result.UserID != null) { MessageBox.Show("Success!"); } else { MessageBox.Show($"Failure: {result.FailureReason}"); } }
private async void SubmitButton_Click(object sender, EventArgs e) { if (!ValidatePasswords()) { MessageBox.Show("Passwords don't match."); return; } var request = AuthenticatorService.GetCredentials(UsernameTextbox.Text, PasswordTextbox.Text); var result = await AuthenticatorService.Service.RegisterPlayerAsync(request); if (result.PlayerID == null) { MessageBox.Show("Username already taken"); return; } this.Close(); this.sender.Show(); }