public async Task <ActionResult> SelectFactorAsync(SelectFactorViewModel model) { var selectedFactor = ((List <Factor>)Session["factors"])?.FirstOrDefault(x => x.Type == model.FactorType); if (selectedFactor != null && selectedFactor.Type == "sms") { return(RedirectToAction("EnrollSms", "Manage")); } throw new NotImplementedException("This flow has not been implemented yet."); }
// GET: /Manage/SelectFactor public ActionResult SelectFactor() { var factors = ((List <Factor>)Session["factors"]) .Select(x => new FactorViewModel { Type = x.Type }).ToList(); var viewModel = new SelectFactorViewModel { Factors = factors, FactorType = factors.FirstOrDefault().Type, }; return(View(viewModel)); }