NuGetGallery.UsersController.Confirm C# (CSharp) Method

Confirm() public method

public Confirm ( string username, string token ) : System.Web.Mvc.ActionResult
username string
token string
return System.Web.Mvc.ActionResult
        public virtual ActionResult Confirm(string username, string token)
        {
            if (String.IsNullOrEmpty(token)) return HttpNotFound();
            var user = userService.FindByUsername(username);
            if (user == null) return HttpNotFound();

            string existingEmail = user.EmailAddress;
            var model = new EmailConfirmationModel
            {
                ConfirmingNewAccount = String.IsNullOrEmpty(existingEmail),
                SuccessfulConfirmation = userService.ConfirmEmailAddress(user, token)
            };

            if (!model.ConfirmingNewAccount) messageService.SendEmailChangeNoticeToPreviousEmailAddress(user, existingEmail);
            return View("~/Views/Users/Confirm.cshtml", model);
        }