protected void ProviderSubmit_Click(object sender, EventArgs e) { if (!signinManager.SendTwoFactorCode(Providers.SelectedValue)) { Response.Redirect("/Account/Error"); } var user = manager.FindById(signinManager.GetVerifiedUserId <ApplicationUser, string>()); if (user != null) { var code = manager.GenerateTwoFactorToken(user.Id, Providers.SelectedValue); } SelectedProvider.Value = Providers.SelectedValue; sendcode.Visible = false; verifycode.Visible = true; }
public bool SendTwoFactorCode(string provider) { return(signInManager.SendTwoFactorCode(provider)); }