public async Task <IActionResult> ConfirmEmail(string userId, string code) { if (userId == null || code == null) { return(View("Error")); } var user = await _userManager.FindByIdAsync(userId); if (user == null) { return(View("Error")); } var result = await _userManager.ConfirmEmailAsync(user, code); return(View(result.Succeeded ? "ConfirmEmail" : "Error")); }