private async Task<ActionResult> ValidateCode(TwoFactorAuthenticationModel model, ClaimsIdentity partialSignInUser) { var twoFactorTokenService = new TwoFactorTokenService(); var codeValid = twoFactorTokenService.VerifyTwoFactorCodeFor( partialSignInUser.GetSubjectId(), model.Code); if (codeValid) { return Redirect(await GetOwinContext().Environment.GetPartialLoginResumeUrlAsync()); } return View("This code is invalid."); }