public IActionResult ConfirmEmail(string userId, string code) { if (userId == null || code == null) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } UserData user = _authentication.GetUserById(userId); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{userId}'."); } AuthResult result = _authentication.ConfirmEmail(userId, code); return(View(result.Succeded ? "ConfirmEmail" : "Error")); }