private async Task TwoFactorAuthAsync() { var tfaDialog = new TwoFactorAuthDialog(); var dialogResult = await tfaDialog.ShowAsync(); if (dialogResult == ContentDialogResult.Primary) { await TryNavigateToMainPage(); } }
async Task ShowTwoFactorNumberInputDialogAsync(Uri uri, NiconicoContext context) { var dialog = new TwoFactorAuthDialog() { IsTrustedDevice = true, DeviceName = "Hohoema_App" }; var result = await dialog.ShowAsync(); if (result == Windows.UI.Xaml.Controls.ContentDialogResult.Primary) { var codeText = dialog.CodeText; var isTrustedDevice = dialog.IsTrustedDevice; var deviceName = dialog.DeviceName; var mfaResult = await NiconicoSession.TryTwoFactorAuthAsync(uri, context, codeText, isTrustedDevice, deviceName); Debug.WriteLine(mfaResult); } }
async Task <NiconicoSessionLoginRequireTwoFactorAuthResponse> ShowTwoFactorNumberInputDialogAsync(Uri uri) { await Task.Delay(250); var dialog = new TwoFactorAuthDialog() { IsTrustedDevice = true, DeviceName = "Hohoema_App" }; var result = await dialog.ShowAsync(); if (result == Windows.UI.Xaml.Controls.ContentDialogResult.Primary) { return(new NiconicoSessionLoginRequireTwoFactorAuthResponse(dialog.CodeText, dialog.IsTrustedDevice, dialog.DeviceName)); } else { return(null); } }