Ejemplo n.º 1
0
        public async Task <ActionResult> SendCode(string returnUrl, bool rememberMe)
        {
            var userId = await SignInManager.GetVerifiedUserIdAsync();

            if (userId == null)
            {
                return(View("Error"));
            }
            var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(userId);

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

            return(View(new SendCodeViewModel {
                Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe
            }));
        }