private void loginButton_Click(object sender, RoutedEventArgs e) { var authenticator = new VRCAuthenticator(userName.Text, password.Password); api = authenticator.loginAsync().Result; if (api != null && !authenticator.isTwoAuthentication()) { loginButton.IsEnabled = false; } else if (api != null && authenticator.isTwoAuthentication()) { var result = authenticator.verifyTwoFactor(int.Parse(oneTimePassword.Text)); if (result) { loginButton.IsEnabled = false; var userConfig = api.getUserConfig(); Name.Content = userConfig.username; } else { MessageBox.Show("2FA Failed."); return; } } else if (api == null) { MessageBox.Show("Invalid Username or Password"); return; } MessageBox.Show("Logined."); }
public avatarWindow(VRCAPI.VRCAPI vrcApi, VRCAPIBase.AvatarObject currentAvatar) { api = vrcApi; avatar = currentAvatar; InitializeComponent(); this.Title = avatar.name; idLabel.Content = avatar.id; nameLabel.Content = avatar.name; descriptionLabel.Content = avatar.description; versionLabel.Content = avatar.version.ToString(); featuredLabel.Content = avatar.featured.ToString(); created_atLabel.Content = avatar.created_at; updated_atLabel.Content = avatar.updated_at; releaseStatusLabel.Content = avatar.releaseStatus; platformLabel.Content = avatar.platform; }