Ejemplo n.º 1
0
        private async Task TwoFactorAuthAsync()
        {
            var tfaDialog    = new TwoFactorAuthDialog();
            var dialogResult = await tfaDialog.ShowAsync();

            if (dialogResult == ContentDialogResult.Primary)
            {
                await TryNavigateToMainPage();
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }