예제 #1
0
        public async Task <ActionResult> VerifyCode(string provider, string returnUrl)
        {
            // Require that the user has already logged in via username/password or external login
            if (!await SignInManager.HasHasBeenVerifiedAsync2())
            {
                return(View("Error"));
            }

            var user = await UserManager.FindByIdAsync(await SignInManager.GetVerifiedUserIdGuidAsync());

            if (user != null)
            {
                ViewBag.Status = "Demonstração: Caso o " + provider + " não chegue informe este código para verificar: " +
                                 await UserManager.GenerateTwoFactorTokenAsync(user.Id, provider);
            }

            return(View(new VerifyCodeViewModel {
                Provider = provider, ReturnUrl = returnUrl
            }));
        }