public virtual async Task <IActionResult> OnGetAsync()
        {
            Input = new SendCodeInputModel();

            var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();

            if (user == null)
            {
                // 双因素信息验证失败,一般都是超时了或者用户信息变更
                Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]);
                return(Page());
            }
            var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(user);

            Providers = userFactors.Select(purpose => new SelectListItem {
                Text = purpose, Value = purpose
            }).ToList();

            return(Page());
        }
Exemple #2
0
        public virtual IActionResult OnGet()
        {
            SendCodeInput = new SendCodeInputModel();

            return(Page());
        }