public async Task <IActionResult> SendCode(string returnTo, bool rememberMe) { var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); if (user == null) { return(View("Error")); } var providers = await _userManager.GetValidTwoFactorProvidersAsync(user); var providerList = providers.Select(provider => new SelectListItem { Value = provider, Text = provider }) .ToList(); return(View(new SendCode { RememberMe = rememberMe, ReturnTo = returnTo, Providers = providerList })); }
public async Task <IActionResult> OnGet(string returnTo, bool rememberMe) { var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); if (user == null) { return(RedirectToPage("/Error")); } var providers = await _userManager.GetValidTwoFactorProvidersAsync(user); var providerList = providers.Select(provider => new SelectListItem { Value = provider, Text = provider }) .ToList(); SendCode = new SendCode() { Providers = providerList, RememberMe = rememberMe, ReturnTo = returnTo }; return(Page()); }
public async Task <IActionResult> OnGet(string returnTo, bool rememberMe, string provider) { var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); if (user == null) { return(RedirectToPage("/Error")); } VerifyCode = new VerifyCode { RememberMe = rememberMe, ReturnTo = returnTo, Provider = provider }; return(Page()); }