Esempio n. 1
0
        // GET: Account/ConfirmEmail?token=value&email=value
        public async Task <IActionResult> ConfirmEmail(string token, string email)
        {
            if (User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Index", "Profile"));
            }

            UserModel user = await ManageUser.FindByEmailAsync(email);

            if (user != null && !await ManageUser.IsEmailConfirmedAsync(user))
            {
                var result = await ManageUser.ConfirmEmailAsync(user, token);

                if (result.Succeeded)
                {
                    return(RedirectToAction("Login"));
                }
            }

            return(View("Verify"));
        }